Create polyline from file
Posted: Tue Jul 10, 2007 10:26 am
Hello All,
I'm trying to create a ployline from a text file. I use a similar code to create lines from point to point. What is missing in this code? It appears to only create the first point in the file.
Do While Not EOF(1)
Input #1, number, XCOORD, YCOORD, ZCOORD, code
Set myPoints = Library.CreatePoints
Set pt = Library.CreatePoint(XCOORD, YCOORD, ZCOORD)
myPoints.Add
myPoints(myPoints.Count).x = pt.x
myPoints(myPoints.Count).y = pt.y
myPoints(myPoints.Count).z = pt.z
Loop
Close #1
Set myPline = ThisDocument.ModelSpace.AddPolyline(myPoints)
myPline.Update
ThisDocument.ActiveViewport.ZoomExtents
thanks MikeC
I'm trying to create a ployline from a text file. I use a similar code to create lines from point to point. What is missing in this code? It appears to only create the first point in the file.
Do While Not EOF(1)
Input #1, number, XCOORD, YCOORD, ZCOORD, code
Set myPoints = Library.CreatePoints
Set pt = Library.CreatePoint(XCOORD, YCOORD, ZCOORD)
myPoints.Add
myPoints(myPoints.Count).x = pt.x
myPoints(myPoints.Count).y = pt.y
myPoints(myPoints.Count).z = pt.z
Loop
Close #1
Set myPline = ThisDocument.ModelSpace.AddPolyline(myPoints)
myPline.Update
ThisDocument.ActiveViewport.ZoomExtents
thanks MikeC