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

how to use readAddress and writeAddress

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
ghostpass
527 Views, 6 Replies

how to use readAddress and writeAddress

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?

6 REPLIES 6
Message 2 of 7

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.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Message 3 of 7
artc2
in reply to: philippe.leefsma

writeAddress() and readAddress() are for filers that are not filing to/from disk.  For example, undo and copy filers.

Message 4 of 7

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!

Message 5 of 7

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.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Message 6 of 7

Thanks for all your help. I adopt your idea and store the block record name in my custom entity.it is so easy! And this let me know how to complete my task.
Message 7 of 7

Sounds good 🙂



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

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

Post to forums  

Autodesk Design & Make Report

”Boost