.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Keep entity custom information outside sessions

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Anonymous
631 Views, 4 Replies

Keep entity custom information outside sessions

Hello, 

what would be best approach (except ObjArx) to make "custom" object oriented design to keep additional properties which are generated from geometry or its input typed into plugin form property fields on form.

I have thought of saving them as OO objects as xml/json tied to layers,blocks etc. and retrieving them by entity handle.

What is the right way of getting the entity by handle and what is meant by "oldId" property within .NET API, or should i just cast "handle" to long data type and storing it as unique id for those lines, blocks which i want additional information.

In some sense, lines, cirlces, blocks used by plugin are vanilla cad entities but i want to tie the additional information to them to manipulate in read/write fashion.

Thank you for your opinions.

@_gile 

 

Labels (3)
4 REPLIES 4
Message 2 of 5
_gile
in reply to: Anonymous

Hi,

 

I'd use the extension dictionary of the entity to store the data either directly in one ore more Xrecords or in a named dictionary nested in the extension dictionary.

You can also get some inspiration from this topic if you need to serialize a .NET class.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 3 of 5
Anonymous
in reply to: _gile

Thank you @_gile !

Have a nice day.

Message 4 of 5
norman.yuan
in reply to: Anonymous

Since you are "Geodetic Spacialist", you are presumably using or dealing with AutoCAD verical(s) rather than plain AutoCAD, such as AutoCAD Map and/or AutoCAD Civil. AutoCAD verticals usually come with its own specialized approach to associate data attributes to AutoCAD entities, which might be more suitable to handing entity specific data in that vertical product. So, besides what @_gile has said, you may want to take those approaches into account, if you are using AutoCAD verticals. So, here are your options (I did not list all of the verticals, because I may not know all of them):

 

Plain AutoCAD:

entity data: XData, ExtensionDictionary: per document data: named dictionary

 

AutoCAD Map:

all of for plain AutoCAD, plus entity data: ObjectData, Object Classification (and perhaps FDO data connection, but the object in drawing is not native AutoCAD entity, so you may not want to count it)

 

AutoCAD Civil:

 

all of for AutoCAD Map, plus UFD (User defined classification data), PropertySet Data (which applies to all AEC verticals, such as AutoCAD Arch/MEP/Mechanical

 

If you are using Map/Civil, ObjectData might be the most used/popular type in comparison to ExtensionDictionary/XData.

 

 

Norman Yuan

Drive CAD With Code

EESignature

Message 5 of 5
Anonymous
in reply to: norman.yuan

Yes i'm aware of that, i could use gis capabilities easily but i want to
manipulate plain autocad via attributes. Thank you anyway.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report