nataca Posted February 22, 2010 Posted February 22, 2010 I'm learning Reactor. I want to use reactor for ATT Block. In found in help: vlr-object-reactor -> :vlr-subObjModified but don't have any Example about :vlr-subObjModified Thanks. Quote
Lee Mac Posted February 22, 2010 Posted February 22, 2010 Example: (defun c:Start_Object_Reactor nil (if (not (vl-position "ATT-REACT" (mapcar (function (lambda (x) (strcase (vlr-data x)))) (cdar (vlr-reactors :vlr-object-reactor))))) (if (and (princ "\n Select Objects to Trigger Reactor: ") (setq i -1 ss (ssget '((0 . "INSERT") (66 . 1))))) (progn (while (setq ent (ssname ss (setq i (1+ i)))) (setq OwnerList (cons (vlax-ename->vla-object ent) OwnerList))) (vlr-object-reactor OwnerList "Att-React" (list (cons :vlr-subobjmodified 'DoIt))))) (princ "\n** Object Reactor Already Running **")) (princ)) (defun DoIt (Object Reactor Args) (alert (strcat "You Modified an Attribute in Block: " (vl-prin1-to-string Object))) (princ)) (defun c:End_Object_Reactor (/ React) (if (and (setq React (vl-some (function (lambda (x) (if (eq "ATT-REACT" (strcase (vlr-data x))) x))) (cdar (vlr-reactors :vlr-object-reactor)))) (vlr-added-p React)) (vlr-remove React) (princ "\n** Reactor Not Running **")) (princ)) Quote
nataca Posted February 23, 2010 Author Posted February 23, 2010 thanks Lee. I have 2 attriblock. attriblock1 have: Tag1 ->string1 attriblock2 have: Tag2 ->string2 I want always string1 = string2. Help me code in function "DO IT" vlr-object-reactor OwnerList "Att-React" (list (cons :vlr-subobjmodified 'DoIt))))) Quote
RobyG Posted February 16, 2012 Posted February 16, 2012 Hi Lee, This is about what I need, but why does the alert fire once for each attribute in the block when I only change one or none and then use ok ? If canceled it does not fire the alert. my code in the Doit part only needs to happen once each time the block is accessed and modified. Thanks roby Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.