ollie Posted July 24, 2009 Posted July 24, 2009 Hi All I've been trying my hand at reactors lately.The main question i have for now is; Is it possible to determine which entities you have highlighted without having to run a selection function or something similar? Thanks Quote
Lee Mac Posted July 24, 2009 Posted July 24, 2009 Do you mean which entities are currently selected by the user? If so, you could use: (setq ss (cadr (ssgetfirst))) Lee Quote
ollie Posted July 31, 2009 Author Posted July 31, 2009 Do you mean which entities are currently selected by the user? If so, you could use: (setq ss (cadr (ssgetfirst))) Lee Not quite When you select an entity and take no action i would like to start a reactor Quote
Lee Mac Posted July 31, 2009 Posted July 31, 2009 Well, you could use an object reactor I suppose, using: :vlr-openedForModify but I am not sure if it would work or not. Quote
Lee Mac Posted July 31, 2009 Posted July 31, 2009 Just tested the above theory using: (defun c:ObjON () (vl-load-com) (if (not *Obj) (setq *Obj (vlr-object-reactor (mapcar 'vlax-ename->vla-object (mapcar 'cadr (ssnamex (ssget "_X")))) nil (list (cons :vlr-openedforModify 'ModObj))))) (princ)) (defun ModObj (Obj Rea Arg) (princ (vl-princ-to-string Obj)) (princ)) It is obvious from this that it doesn't quite fire exactly when you want it to. I am not sure what else you could try though... Quote
Lee Mac Posted July 31, 2009 Posted July 31, 2009 On second thoughts, this would be something like what you are after: (defun c:ObjON () (vl-load-com) (if (not *Obj) (setq *Obj (vlr-miscellaneous-reactor nil (list (cons :vlr-pickfirstModified 'ModObj))))) (princ)) (defun ModObj (Reac Args) (alert "Selected!") (princ)) (defun c:ObjOFF () (if *Obj (progn (vlr-remove *Obj) (setq *Obj nil))) (princ)) Using a Miscellaneous Reactor, with the :vlr-pickfirstModified callback. 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.