Hi,all:
i want to write and read custom data in my custom entity,and i want to use readAddress() and writeAddress();but i dont know use them; can anyone help me or give an example?
Solved! Go to Solution.
Solved by philippe.leefsma. Go to Solution.
Those methods seem to crash AutoCAD while invoked, in addition to that I do not find any previous example of use from our internal database.
I also don't see why you would need to read/write an address from your custom entity filer. This kind of operation looks like very risky, as you have no guarantee addresses will map to the same object across sessions. Could you clarify your use case?
Thanks,
Philippe.
writeAddress() and readAddress() are for filers that are not filing to/from disk. For example, undo and copy filers.
as this,i made a custom entity,it contain AcDbBlockReference class(it contain lots of arcs ,circles and lines),and i want to save it in my coustom entity.i can't find appropriate method to make it.
so i guess the readAddress and writeAddress may achieve my purpose. will this help me?
Thanks!
The readAddress and writeAddress methods do not apply in case of a custom entity filer, as mentionned by the previous comments.
It doesn't matter what your block contains, what matter is wether or not the block reference is database resident or not.
Do you create the block reference in memory and use the instance to display it in your worldDraw? If that's the case, what you need to do is simply store all the properties you need to re-instanciate it when you open the drawing during a new session.For example in the dwgOut you will store the block record name, position and rotation of the bref, then in dwgIn you will recreate an instance of the bref based on the properties you saved.
Regards,
Philippe.
Sounds good 🙂