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.
Solved! Go to Solution.
Solved by _gile. Go to Solution.
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.
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
Can't find what you're looking for? Ask the community or share your knowledge.