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

Is there any event like attribute text changed?

4 REPLIES 4
Reply
Message 1 of 5
aliensinearth
410 Views, 4 Replies

Is there any event like attribute text changed?

Hello Gentlemen,

 

I have a block which have two attributes. one for GPM and another for Pipe-Size

I have a written lisp program which will read value of GPM attribute and automattically change the Pipe-Size attribute. Now, this is accomplished manually, means, I have to select that block to change the Pipe_Size.

 

What I am looking for, is that, the Pipe_Size attribute should be changed automatically as soon as the GPM attribute is changed. Is there any autocad event like textchanged event or attribute changed event that can be triggered automatically without selecting the block.

 

Sorry, if i have not explained properly. If you don't understand, I will explain once more.

 

Thanks.

4 REPLIES 4
Message 2 of 5

Hi

 

You are posting to the .Net section of the forum, so I am assuming you are looking for a .Net solution. If you are looking for Lisp, please post your question to the dedicated Lisp section.

 

In .Net a first suggestion would be to use Database.ObjectModified event, which will probably be fired when the text has been changed. You can also listen to events at an object specific level using DBObject.Modified event.

 

Hope that helps,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Message 3 of 5

Thank you very much philippe.leefsma.
I will try with your code. I was looking for a .Net solution only since event handling is easier than autolisp's vlr fuctions which i don't know.

Thanks.
Message 4 of 5

Hi philippe.leefsma,

Can you please tell me how to register this event only for a particular drawing & particular block? I don't need this in all the drawings.
Message 5 of 5

Once you get a reference to the block you are interested in, you can regsiter for Modified event.

 

Do a google search for Database.ObjectModified and DBObject.Modified, you should be able to stumble across many examples.

 

Let us know if you get stuck.

 

Thanks,

Philippe.



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 DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost