This example illustrates how to create and write a new shape which consists of five vertices of a closed polygon.
local Vertex points[5]
local int shape
local int tfid, segment_num
local string temp_file
segment_num = 28
try
temp_file = "./my.pix"
delete temp_file noerror
call CopyFile( GetPCIHOME() + "/demo/irvine.pix", \
temp_file)
tfid = DBOpen(temp_file, "r+")
shape = VECCreateShape(tfid,segment_num)
points[1].x = 0
points[1].y = 0
points[1].z = 0
points[2].x = 100
points[2].y = 0
points[2].z = 0
points[3].x = 100
points[3].y = 100
points[3].z = 0
points[4].x = 0
points[4].y = 100
points[4].z = 0
points[5].x = 0
points[5].y = 0
points[5].z = 0
call VECSetVertices( tfid, segment_num, shape, 5, points )
call DBClose(tfid)
onerror
print "Error: "+ GetLastErrorMessage()
endonerror
© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.