Oh James!
It's cool!
I've never tryed to do such a thing but I really wanted to do... ....because I make only my first steps on the Planet of Reactors...
But I was so lucky to understand your code & so cheeky
to make some modifications! Sorry! : )
I did it:
1. to slightly change its behaviour for Dimensions and Blocks:
a. to ALWAYS call for DDEDIT for Dimensions (so user didn't have to hit the DimText!) b. to call REFEDIT for Blocks with no Attributes c. to ALWAYS call ATTEDIT for Blocks with Attributes (so user didn't have to hit the Attribute!)
2. to Close OPM if it is on the screen already
My question: is there no method to get rid of this LISP info in the command line indeed
"_.attedit (princ (car (nentselp (trans (car point) 0 1)))) "
???
If there was such a way this code works more like AutoCAD native commands:
Command: _.eattedit 143.600225,133.829305,0.000000
???
;;; ======================================================== ;;; ;;;Construct the callback function ;;; ;;; ======================================================== (defun jb:beginDoubleClick ( reactorObject Listofsomething / point parentEn ; - New parent childEn ; - New child parentHasAttr ; - New obj-type obj-list cmd refedit gripset jbEditPoint ; - New )
;;; added for error in 2004 - point returned from outside ;;; a paperspace viewport throws an error (if (vl-catch-all-error-p (vl-catch-all-apply 'trans (list (car Listofsomething) 0 1)) ) ; - 'vl-catch-all-error-p' (princ "PaperSpace") (progn (setq point Listofsomething parentEn (car (cadddr (nentselp (trans (car point) 0 1)))) childEn (car (nentselp (trans (car point) 0 1))) gripset (cadr (ssgetfirst)) doc (vlax-get (vlax-get-acad-object) "activedocument") ) ; - 'setq' ;;; (if childEn (progn (if (not parentEn) (setq parentEn childEn) ) ; - 'if' (setq parent (vlax-get (vlax-ename->vla-object parentEn) "objectname") child (vlax-get (vlax-ename->vla-object childEn) "objectname") ) ; - 'setq' ;; +++++++++++++++++++++++++++ Source +++++++++++++++++++++++++++ ; (if (= (strcase parent) "ACDBBLOCKREFERENCE") ; (setq obj-type "ACDBBLOCKREFERENCE") ; (setq obj-type (strcase child)) ; ) ; - 'if' ;; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;; +++++++++++++++++++++++++++++ NEW ++++++++++++++++++++++++++++ (if (= (strcase parent) "ACDBBLOCKREFERENCE") (progn (setq parentHasAttr (vlax-get (vlax-ename->vla-object parentEn) HasAttributes")) (if (= parentHasAttr 0) (setq obj-type "ACDBBLOCKREFERENCE") (setq obj-type (strcase "ACDBATTRIBUTE")) ) ; - 'if' ) ; - 'progn' (setq obj-type (strcase parent)) ) ; - 'if' ;; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;;; Added refedit check for swiching mspsace to pspsace 03.04.2003 ;;; Limitation: can't refedit from paperspace in a viewport!!!! (if (not (and (= obj-type "ACDBBLOCKREFERENCE") (= (vlax-invoke doc "getvariable" "tilemode") 0) (> (vlax-invoke doc "getvariable" "cvport") 1) ) ; - 'and' ) ; - 'not' ;;; This is where you change the command:
(progn
(setq jbEditPoint (cdr (nentselp (trans (car point) 0 1)))) (setq fulllist (list (cons "ACDBBLOCKREFERENCE" ;; Source ;; "_.refedit (princ (cdr (nentselp (trans (car point) 0 1)))) " ;; New "_.refedit (princ jbEditPoint) " ) (cons "ACDBATTRIBUTE" ;; Source ;; "_.attedit (princ (car (nentselp (trans (car point) 0 1)))) " ;; New "_.attedit (princ jbEditPoint) " ) (cons "ACDBMTEXT" "_.DDEDIT ") (cons "ACDBTEXT" "_.DDEDIT ") (cons "ACDBMLINE" "_.MLINEEDIT ") (cons "ACDBATTRIBUTEDEFINITION" "_.DDEDIT ") (cons "ACDBHATCH" "_.HATCHEDIT ") ;; New (cons "ACDB*DIMENSION" "_.DDEDIT ") (cons "ACDBFCF" "_.DDEDIT ") ; - for 'TOLERACNE' ) ; - 'list' ) ; - 'setq fullist' (foreach x fulllist ;; Source ; (if (= obj-type (car x)) ;; New (if (wcmatch obj-type (car x)) (setq cmd (cdr x)) ) ; - 'if' ) ; - 'foreach' ;;; if an object type isn't defined used Properties (if (not cmd) ;; ;; Source ;; (vla-sendcommand doc "_.properties ") ;; New ;; ;;; ------------------------------------------------------------------------ ;;; ;;; Run or Hide Properties! ;;; ;;; ------------------------------------------------------------------------ (if (= (vlax-invoke doc "getvariable" "opmstate") 0) (setq cmd "_.properties ") (setq cmd "_.propertiesclose ") ) ; - 'if' ;;; ------------------------------------------------------------------------ ) ; - 'if' ;;; make adjustment to command ;;; Added multiple select 12.15.2002 (cond ((and gripset (> (sslength gripset) 1)) ;;; more than one entity gripped ;; ;; Source ;; (vla-sendcommand doc "_.properties ") ;; New ;; ;;; ------------------------------------------------------------------------ ;;; ;;; Run or Hide Properties! ;;; ;;; ------------------------------------------------------------------------ (if (= (vlax-invoke doc "getvariable" "opmstate") 0) (vla-sendcommand doc "_.properties ") (vla-sendcommand doc "_.propertiesclose ") ) ; - 'if' ;;; ------------------------------------------------------------------------ ) ((and gripset (= (sslength gripset) 1)) ;;; probably multiple attributes in a block (vla-sendcommand doc cmd) ) (t (vla-sendcommand doc cmd)) ) ; - 'cond' ) ) ) ) ) ; - 'progn' ) ; - 'if' ;; ;; New ;; ;; ***************************************************************** (if (vlax-object-released-p doc) (vlax-release-object doc)) ;; ***************************************************************** (princ) ) ; - 'defun jb:beginDoubleClick' ;;; ========================================================
;;; ======================================================== ;; ;; Why do not add?

;; (vl-load-com)
;;;Construct the reactor
(defun jb:LoadDoublClickReactor (/)
(if (/= (type jbDoubleClickReactor) 'VLR-Mouse-Reactor) (setq jbDoubleClickReactor (VLR-Mouse-Reactor nil '(

VLR-beginDoubleClick . jb:beginDoubleClick)) ) ; - 'VLR-Mouse-Reactor' ) ; - 'setq' ) ; - 'if'
(if (not (vlr-added-p jbDoubleClickReactor))
(vlr-add jbDoubleClickReactor)
) ; - 'if'
;;; Unload acdblclkedit.arx in favor of My Expanded Double Click editing! (if (member "acdblclkedit.arx" (arx)) (arxunload "acdblclkedit.arx" nil) ) ; - 'if' (princ) ) ; - 'jb:LoadDoublClickReactor' ;;; ========================================================