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)
)
)