Visual LISP, AutoLISP and General Customization

Reply
Contributor
Posts: 19
Registered: ‎06-21-2012
Message 1 of 5 (165 Views)

event handler

165 Views, 4 Replies
07-19-2012 04:08 PM

Is it possible to write an event handler for an autocad event/ command like insert new block ? I want the event to trigger the execution of an update routine . something like this post

http://forums.autodesk.com/t5/Visual-Basic-Customization/comand-event-listener/td-p/2149719

 

how do I access the autocad object in autolisp?

Thanks,

Insia

 

Distinguished Mentor
Moshe-A
Posts: 711
Registered: ‎09-14-2003
Message 2 of 5 (148 Views)

Re: event handler

07-20-2012 02:38 AM in reply to: insiaiftiqhar

Insia,

 

that's depand on what you are planning to do when insert command is fired?

can you clarify?

 

Moshe

 

 

Contributor
Posts: 19
Registered: ‎06-21-2012
Message 3 of 5 (133 Views)

Re: event handler

07-20-2012 12:07 PM in reply to: Moshe-A

I have a DCL window where I let the modeller specify a value type for each attribute of each block in the drawing and I store it in a nested association list . The association list is as follows 

((blockName1 attributeAssociationList1) (blockName2 attributeAssociationList2)

where attributeAssnList is another association list like

((attributeTagName1 attributeValueType1) ((attributeTagName2 attributeValueType2) 

 

I have an updateAssociationList function which updates this data structure by comparing it against the state of the current drawing.

I was hoping to call this function when a block/attribute is inserted /deleted /edited.

 

Thank you ,

Insia

Distinguished Mentor
Moshe-A
Posts: 711
Registered: ‎09-14-2003
Message 4 of 5 (125 Views)

Re: event handler

07-20-2012 10:37 PM in reply to: insiaiftiqhar

Hi,

 

if i understand you right? you have some blocks attribute data list that store where? in an external file?

and you got some dwg files that you want to update their attributes value?

 

i do not think that this should be done with Reactors, all you need is to run your update routine on the blocks

to update their attributes and attributes values as a batch and that it?

 

Moshe

 

 

Contributor
Posts: 19
Registered: ‎06-21-2012
Message 5 of 5 (105 Views)

Re: event handler

07-23-2012 07:55 AM in reply to: Moshe-A

I wasn't aware of the concept of reactors..seems to me that is what I was looking for. I think I agree with you though, It might not be worth the overhead. I have to look into reactors a bit more.thank you for pointing me in the right direction.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community