Save geometry data to ESRI shape(SHP) files
You can use this code to write each layer of the THBVector object to shape files.
spVector.LoadFromFile(strFileName, thbvfAutoDetect)
Dim arLayers As THBArrayString
Set arLayers = spVector.Layers.LayerNames
for nLayer=0 to arLayers.Size-1
strOutFileName = strPathTmp + strName + "_" + arLayers.At(nLayer) + ".SHP"
spVector.FileFormatSettings.SHPWriteLayer = arLayers.At(nLayer)
spVector.SaveToFile(strOutFileName, thbvfShape)
Next
You can use this code to write all layers of THBVector object to shape files. spVector.LoadFromFile(strFileName, thbvfAutoDetect) spVector.FileFormatSettings.SHPWriteLayer = ”” spVector.SaveToFile(strOutFileName, thbvfShape) SHPWriteLayer specifies which layer you’d like to write out. If you set it to an empty string it will write out all layers, each layer into a separate shapefile, assigning different names to the output file.



RSS News Feed