• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Visual LISP, AutoLISP and General Customization

    Reply
    Contributor
    Posts: 19
    Registered: ‎06-21-2012

    event handler

    121 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

     

    Please use plain text.
    Distinguished Mentor
    Moshe-A
    Posts: 679
    Registered: ‎09-14-2003

    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

     

     

    Please use plain text.
    Contributor
    Posts: 19
    Registered: ‎06-21-2012

    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

    Please use plain text.
    Distinguished Mentor
    Moshe-A
    Posts: 679
    Registered: ‎09-14-2003

    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

     

     

    Please use plain text.
    Contributor
    Posts: 19
    Registered: ‎06-21-2012

    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.

    Please use plain text.