Convert DatabaseServices.Polyline to Dynamo Polyline

Good morning,

I’m trying to get the geometry from a parcel segment. I’ve selected the parcel segment and opened it up to get the baseline in Python. This returns Autodesk.AutoCAD.DatabaseServices.Polyline which isn’t something I can use in Dynamo. The method from google that is used to convert it to a dynamo object is to grab the polyline’s ObjectId and use t.GetObject(Id, OpenMode) to convert to a dynamo polyline. However, since this polyline is the baseline of an parcel segment the ObjectId for the baselines is returning (0).

Is there a good way to convert from Autodesk.AutoCAD.DatabaseServices.Polyline to a Dynamo Polyline object?

image

The Arkance Systems Node Library contains a node to get Dynamo geometry from parcels.

I don’t know how it works in Python. Normally you can convert a polyline with the Dynamo functions to a polycurve, but I don’t think it works on a parcel’s baseline.

1 Like

This doesn’t answer your question, but FYI the Civil 3D Toolkit has a node to get parcel geometry as well.

1 Like

One clarification: are you trying to extract the parcel geometry and output a new polyline into model space? Or are you trying to get a Dynamo polycurve only?

I’m trying to set a custom attribute for each parcel segment based on its geometry. Either making a new polyline or a Dynamo polycurve could work. I ended up making a new polyline in model space then extracted that polyline’s geometry. Code below for anyone interested:

1 Like