mcguirepm Posted October 8, 2008 Posted October 8, 2008 I am trying to write a routine that will activate anytime someone tries to move specific entities around by their grips. Does anyone have any good ideas where to start? Thanks. Quote
ASMI Posted October 8, 2008 Posted October 8, 2008 You can to use couple of Command and AcDb reactors. For example turn reactors by GRON command and make grip rotation for some object (GROFF to turn off): (defun c:gron() (vl-load-com) (if(not grip:reactor) (setq grip:reactor (vlr-Command-Reactor nil '((:vlr-CommandEnded . GripReaction)) ); end vlr-Command-Reactor ); end setq ); end if (if(not acdb:reactor) (setq acdb:reactor (vlr-AcDb-Reactor nil '((:vlr-objectModified . GripModified)) ); end vlr-Command-Reactor ); end setq ); end if (princ) ); end of c:gron (defun c:groff() (if grip:reactor (progn (vlr-remove grip:reactor) (setq grip:reactor nil) (vlr-remove acdb:reactor) (setq acdb:reactor nil) ); end progn ); end if (princ) ); end of c:groff (defun GripModified(Reac Args / lEnt) (setq lEnt(vlax-ename->vla-object(cadr Args)) gron:lastent(strcat(vla-get-ObjectName lEnt) " ID: "(itoa(vla-get-ObjectID lEnt))) ); end setq (princ) ); end of GripModified (defun GripReaction(Reac Args) (if(equal "GRIP_ROTATE"(car Args)) (if gron:lastent (alert (strcat "You have just rotated:\n" gron:lastent)) ); end if ); end if (princ) ); end of GripReaction 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.