Remove MText Content on dwg file using c#.net

Remove MText Content on dwg file using c#.net

manohar2375
Advocate Advocate
734 Views
1 Reply
Message 1 of 2

Remove MText Content on dwg file using c#.net

manohar2375
Advocate
Advocate

Hi Sir,

 

I have written a function to write string using MText Object (MText.Contents) by C#.net on dwg file. And i want to remove that contents which is i written with out using content by C#.net. Because on the dwg file we have a lot of other MText contents are there but i want to remove which i written by another function in C#.net. Could you please help me.

 

Thank you & Regards,

Manohar.

0 Likes
735 Views
1 Reply
Reply (1)
Message 2 of 2

_gile
Consultant
Consultant

Hi,

 

You have to store an identifier of the new MText instance when you create it so that you can get it from another function.

 

The way to store the identifier depends on the way the other function is called: in the same session or in another one.

 

In the same session, you can simply store the ObjectId of the newly created MText in an instance member of the class where the commands are defined (or in the Document.UserData property).

 

To be able to find the MText in another session, the data and storing have to be persistant. You can store the newly created MText Handle in a DBDictionary.

Another way should be adding some specific xdata to the newly created MText.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes