Knowledge Base



KB10338 - Adding a new point, line, or polygon shape in Visual Basic.

Create a Point:

shp = layer.CreateShape(XgisShapeTypePoint)
shp.Lock(1)
shp.AddPart()
shp.AddPoint(ptg1)
shp.Unlock()

Create a Line:

shp = layer.CreateShape(XgisShapeTypeArc)
shp.Lock(1)
shp.AddPart()
shp.AddPoint(ptg1)
shp.AddPoint(ptg2)
shp.Unlock()

Create a Polygon:

shp = layer.CreateShape(XgisShapeTypePolygon)
shp.Lock(1)
shp.AddPart()
shp.AddPoint(ptg1)
shp.AddPoint(ptg2)
shp.AddPoint(ptg3)
shp.Unlock()

 
Created: November 21, 2003, Modified: August 03, 2015
follow us on Facebook  follow us on Twitter  follow us on Google +  follow us on LinkedIn  Embarcadero