Message 1 of 21
Polyline2d Question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
When creating a new Polyline2d, I am assuming that the number of bulges should be 1 less than the number of points? So if you have only 3 points, you have two bulge factors that represent the arcs between points 1/2 and points 2/3. Is that correct?
{code}PolyEnt = New Polyline2d(Poly2dType.SimplePoly, PolyPoints, 0.0, True, 0.0, 0.0, PolyBulges){code}
Also, just a general question, what does the SetDatabaseDefaults function do? If it sets the default layer, color, linetype, etc then I think the following lines of example code are not in the correct order and the SetDatabase defaults function should be moved before the ColorIndex line.
{code}
PolyEnt = New Polyline2d(Poly2dType.SimplePoly, PolyPoints, 0.0, True, 0.0, 0.0, PolyBulges)
PolyEnt.ColorIndex = 3
Using Trans As Transaction = AcadDoc.TransactionManager.StartTransaction()
btr = Trans.GetObject(AcadDoc.Database.CurrentSpaceId, OpenMode.ForWrite)
btr.AppendEntity(PolyEnt)
PolyEnt.SetDatabaseDefaults()
Trans.AddNewlyCreatedDBObject(PolyEnt, True)
Trans.Commit()
End Using
{code}
Thanks
{code}PolyEnt = New Polyline2d(Poly2dType.SimplePoly, PolyPoints, 0.0, True, 0.0, 0.0, PolyBulges){code}
Also, just a general question, what does the SetDatabaseDefaults function do? If it sets the default layer, color, linetype, etc then I think the following lines of example code are not in the correct order and the SetDatabase defaults function should be moved before the ColorIndex line.
{code}
PolyEnt = New Polyline2d(Poly2dType.SimplePoly, PolyPoints, 0.0, True, 0.0, 0.0, PolyBulges)
PolyEnt.ColorIndex = 3
Using Trans As Transaction = AcadDoc.TransactionManager.StartTransaction()
btr = Trans.GetObject(AcadDoc.Database.CurrentSpaceId, OpenMode.ForWrite)
btr.AppendEntity(PolyEnt)
PolyEnt.SetDatabaseDefaults()
Trans.AddNewlyCreatedDBObject(PolyEnt, True)
Trans.Commit()
End Using
{code}
Thanks