Results 1 to 4 of 4

Thread: Reactor to fire when a Table is edited?

  1. #1
    100 Club
    Join Date
    2005-01
    Posts
    185
    Login to Give a bone
    0

    Default Reactor to fire when a Table is edited?

    I want to set up a reactor or something so that anytime a user edits a table a certain LISP routine will always run, any ideas?

  2. #2
    The Silent Type Mike.Perry's Avatar
    Join Date
    2000-11
    Posts
    13,654
    Login to Give a bone
    0

    Default Re: Reactor to fire when a Table is edited?

    Hi "cwade"

    Please note I have *moved* this thread from the AutoCAD Customization forum to this one, as I believe it will be better served here.

    Thanks, Mike

    Forum Manager

  3. #3
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: Reactor to fire when a Table is edited?

    Quote Originally Posted by cwade
    . . . any ideas?
    Yes, search this Lisp Thread for reactor

    : ) Happy Computing !

    kennet
    The essential thing is what you write in the post. . . .not the numbers of posts.

  4. #4
    Past Vice President / AUGI Volunteer peter's Avatar
    Join Date
    2000-09
    Location
    Honolulu Hawaii
    Posts
    1,029
    Login to Give a bone
    0

    Default Re: Reactor to fire when a Table is edited?

    At autodesk university last year I taught a course on Tables called LISP Table Magic. In it I created an object reactor on a table to trigger a lisp routine.

    If you have any more questions let me know.

    Peter

    Code:
    (if (not rxnTableModified)
     (setq rxnTableModified (vlr-object-reactor nil
             "TableModified" '((:vlr-modified . au06:ModifiedTable)))
     )
    )
    
    ; Create object reactor callback function on Bill of Materials Tables
    
    
    (if (setq ssSelections (ssget "x" (list (cons 0 "ACAD_TABLE"))))
     (vlax-for objTable (vla-get-activeselectionset 
                         (vla-get-activedocument 
                          (vlax-get-acad-object)))
      (if (= (vla-get-stylename objTable) "BOM");  <-Change this to be you table name      
       (progn
        (print "Adding Table to Reactor: ")
        (vlr-owner-add rxnTableModified objTable)
       )
      )
     )
    )
    
    ; Object reactor callback function
    
    (defun AU06:ModifiedTable (objTable callback data)
     (if (= blnRerunTable nil)
      (setq blnRerunTable objTable)
     )
    )
    
    ; Create Command Ended Reactor to update table total
    
    (if (not rxnTableComEnd)
     (setq rxnTableComEnd (vlr-editor-reactor nil '((:vlr-commandended . au06:UpdateTableCommandEnded)))) ;<---- this calls the callback function
    )
    
    ; Command Ended Callback Function to Update Table
    ; It calls RetotalTable to recalculate total when price is changed.
    
    
    ;<-- This is the callback function which you can change do not change the two arguments
    (defun AU06:UpdateTableCommandEnded (call callback)
     (if (and blnRerunTable call)
      (progn
       (au06:RetotalTable nil blnRerunTable)
       (setq blnRerunTable nil) 
      )
      (setq blnRerunTable nil)
     )
    )

Similar Threads

  1. vlr-dwg-reactor issue MY FIRST REACTOR
    By treaves04413213 in forum AutoLISP
    Replies: 21
    Last Post: 2013-10-18, 12:36 PM
  2. Edited out of turn!
    By zach.schmitz959200 in forum Vault - General
    Replies: 0
    Last Post: 2011-08-29, 06:58 PM
  3. Replies: 1
    Last Post: 2009-08-14, 01:05 PM
  4. vlr-sysvar-reactor doesn't fire
    By pnorman in forum AutoLISP
    Replies: 1
    Last Post: 2005-04-12, 03:19 PM
  5. Reactor miss-fire
    By pnorman in forum AutoLISP
    Replies: 1
    Last Post: 2005-04-08, 04:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •