Message 1 of 3

Not applicable
02-02-2019
07:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi. How can I draw a polyline from a previously defined collection of 3d points?
I create a collection by:
Dim Linia = New Point3dCollection
Then I add points to this collection through:
Linia.Add(New Point3d((Val(Py)), (Val(Px)), 0))
And I want to draw Polyline from this collection. I use this code:
Using acLckDoc As DocumentLock = acDoc.LockDocument Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction() acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead) acBlkTblRec = acTrans.GetObject(acBlkTbl(BlockTableRecord.ModelSpace), OpenMode.ForWrite) Using acPLine As Polyline = New Polyline() acPLine.AddVertexAt(0, Linia, 0, 0, 0) acBlkTblRec.AppendEntity(acPLine) acTrans.AddNewlyCreatedDBObject(acPLine, True) acPLine.ColorIndex = 1 End Using acTrans.Commit() End Using End Using
But this code causes the following error:
Error BC30311 Value of type 'Point3dCollection' cannot be converted to 'Point2d'.
Solved! Go to Solution.