locate object data or block reference inside polyline

locate object data or block reference inside polyline

Anonymous
Not applicable
922 Views
2 Replies
Message 1 of 3

locate object data or block reference inside polyline

Anonymous
Not applicable

Hi,

I have a Polyline with OD having UniqueTag (ID) for the polyline. Inside the polyline there is also a BlockReference (like a tag to show visual location) which has additional attributes along with UniqueTag.

From .NET C# I am able to read the vertices for polyline and BlockReference Attributes individually. But I am unable to read the UniqueTag (OD:Object Data) in polyline or establish any connection between BlockReference and Polyline. We need to send the vertices and UniqueTag of the polyline to a Geospatial server to render the map in UI.  

 

I am looking for either of the below two options:

1. How to read Object Data or its property from a Polyline ?

       I have seen some code which uses Autodesk.Gis.Map.ObjectData but its giving compiler error as my ObjectARX_2017 do not have this api anymore. We are using Autocad Map 3D 2017.

2. Is it possible locate BlockReference within the polyline and identify the Attributes of Block and tag them to the polyline ?

 

Please suggest if any better alternate options. Thanks in advance.

 

Regards,

Sri 

0 Likes
Accepted solutions (1)
923 Views
2 Replies
Replies (2)
Message 2 of 3

norman.yuan
Mentor
Mentor
Accepted solution

From your description, it looks like the said polyline is associated with the block reference's attribute with OD data (UniqueTag). That is, the block reference is used as sort of "label" for the polyline. Therefore, you'd better off using this data link to pair the block and the polyline, rather than relying on the block being inside the (closed) polyline to prevent accidental error, for example, a user may move the block to outside of the polyline, if the drawing is so crowded.

 

Yes, Autodesk.Gis.Map.ObjectData namespace is the set of APIs to access OD data in AutoCAD Map/Civil3D. You simply set reference in your project to ManagedMapApi.dll (in C:\...[AutoCAD 201x]\Map folder).

 

Since you mention ObjectARX SDK: it is for plain AutoCAD, and it is not "must-have" with AutoCAD .NET API programming. When you do AutoCAD vertical you likely need vertical-specific APIs, if exist. In your case, it is AutoCAD Map, which has ObjectARX Map SDK. Again, it is not "must-have", but if you download it, you'll have the Map .NET API sample code available for you to get started with accessing OD data.

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 3 of 3

Anonymous
Not applicable

Thank you so much. ManagedMapApi.dll helped in locating Object Data for Polyline.

0 Likes