I am trying to find a way that I can store a C # class in an AutoCAD object as an XRecord. For example, I have the following class:
public class ExampleClass { private int x; private int y; public ExampleClass(int x, int y) { this.x = x; this.y = y; } #region Getters and Setters }
and I create an instance of it:
ExampleClass objToStoreInXRecord = new ExampleClass(3, 5);
What is the best way to save this in an AutoCAD object (like a line in the drawing) of XRecord so that I can do something like this:
ExampleClass objRecoveredFromXRecord = GetXRecordFromEntity(Entity e)
Where GetXRecordFromEntity (Entity e) is a helper method that I can write that takes an object e, gets an XRecord of a previously saved object and returns it.
I do not have very good help on how XRecord works and how XRecord relates to a Named Object Oriented AutoCAD (NOD) object. I saw implementations where the object to be stored in XRecord is serialized with binary formatting and the serialized data is stored in the XRecord object, but I'm looking for a better way.
source share