Autodesk 15606-011408-9300 Developer Guide - Page 185
oPnt.SetCoordinates X, Y, For i = 1 To ValstrCnt
UPC - 606121429548
View all Autodesk 15606-011408-9300 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 185 highlights
ConvertSDF Example Code (continued) oTlkt.BeginUpdate j=0 'Read from txt file till eof Do While Not EOF(1) 'Get the feature data Line Input #1, strObjType Line Input #1, strKey Line Input #1, strName Line Input #1, strUrl Line Input #1, strCnt 'Key 'Name 'Url 'Vertex count 'Read the geometry For i = 1 To Val(strCnt) Input #1, X Input #1, Y 'Prepare a point feature oPnt.SetCoordinates X, Y 'Add this point into the segment oSeg.Add oPnt Next i 'Now add this segment into the geometry oGeom.Add oSeg 'Put this geometry into the feature If strObjType = "POLYGON" Then oObj.SetGeometry sdfPolygonObject, oGeom ElseIf strObjType = "POLYLINE" Then oObj.SetGeometry sdfPolylineObject, oGeom ElseIf strObjType = "POINT" Then oObj.SetGeometry sdfPointObject, oGeom Else ShowMessage "Unknown feature in input file." End If 'Set the feature properties oObj.Key = Trim(strKey) oObj.Name = Trim(strName) oObj.Url = Trim(strUrl) 'Add this feature to the SDF file oTlkt.AddObject oObj j=j+1 'Clear the geometry before next use oGeom.RemoveAll oSeg.RemoveAll Loop 'Wind up oTlkt.EndUpdate oTlkt.Close SDF Component Toolkit Applications | 185