Juerg Menzi, thanks for your routine. I have a request. When using your MeChangeCrosshairColor routine, I want to be able to control the crosshairs color between open drawings....having the crosshairs change colors whenever a drawing is made active. The way it stands now, a red crosshair in drawing one with "CVPORT" is "2", will also be red in when "CVPORT" is "1" in drawing two when it is made active. I am doing the same (calling-reactor commandinfo) reactor for my modemacro routine and it works fine. Example: (defun modeexe (calling-reactor commandinfo) (C:MODE) (princ)) This is in my startup: (cond ((>= (distof (substr (getvar "acadver") 1 4)) 15.0) (progn (vl-load-com) ;needs to be loaded first to run reactor (vlr-docmanager-reactor () '((:vlr-documentBecameCurrent . modeexe)))))) Where (C:MODE) is my modemacreo routine command. I need this function to do the crosshair change whenever a drawing document is made active: (defun vportreactor (*do reactor function here*) ) This is what I will place in my statup: (cond ((>= (distof (substr (getvar "acadver") 1 4)) 15.0) (progn (vl-load-com) ;needs to be loaded first to run reactor (vlr-docmanager-reactor () '((:vlr-documentBecameCurrent . vportreactor)))))) Modified MeChangeCrosshairColor routine: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; ;;; ;;; This original Copyrighted routine has been modified... ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; ;;; reactor functions ;;; Juerg Menzi (or Me:Svr (setq Me:Svr (VLR-SysVar-Reactor nil '((:VLR-sysVarChanged . MeChangeCrosshairColor-vport)) ;vport activated ) ) ) (or Me:Dmr (setq Me:Dmr (vlr-DocManager-reactor nil '((:VLR-documentToBeDestroyed . MeDoCloseStuff)) ) ) ) (defun MeDoCloseStuff (Rea Arg) (mapcar 'VLR-remove (list Me:Svr Me:Dmr)) (setq Me:Dmr nil Me:Svr nil ) (princ) ) (defun MeInvGreyCol (Col) (boole 6 (* (* (/ (/ (+ (logand Col 255) (logand (/ Col 256) 255) (logand (/ Col 65536) 255)) 3 ) 128 ) 255 ) 65793 ) 16777215 ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; ;;; the reactor changes crosshair colors on switching SNAPMODE on/off ;;; Juerg Menzi (defun MeChangeCrosshairColor-snap (Rea Arg / AcaDsp AcaDoc AcaObj LayBco ModBco) (if (vl-position (car Arg) '("SNAPMODE" "CVPORT")) (progn (setq AcaObj (vlax-get-acad-object) AcaDoc (vla-get-ActiveDocument AcaObj) AcaDsp (vla-get-Display (vla-get-Preferences AcaObj)) LayBco (vlax-variant-value (vlax-variant-change-type (vla-get-GraphicsWinLayoutBackgrndColor AcaDsp) vlax-vbLong ) ) ModBco (vlax-variant-value (vlax-variant-change-type (vla-get-GraphicsWinModelBackgrndColor AcaDsp) vlax-vbLong ) ) ) ;; ;; Set the cursor color to the appropriate value. ;; Color list: ;; 0 = Black ;; 255 = Red ;; 65535 = Yellow ;; 65280 = Green ;; 16776960 = Cyan ;; 16711680 = Blue ;; 16711935 = Magenta ;; 16777215 = White ;; (if (= (getvar "TILEMODE") 0) (vla-put-LayoutCrosshairColor AcaDsp (if (= (vlax-get (vla-get-ActivePViewport AcaDoc) 'SnapOn) 0) (MeInvGreyCol LayBco) 255 ;Cursor color by Snap on (Layout) ) ) (vla-put-ModelCrosshairColor AcaDsp (if (= (getvar "SNAPMODE") 0) (MeInvGreyCol ModBco) 255 ;Cursor color by Snap on (Model) ) ) ) ) ) (princ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; ;;; the reactor changes crosshair color of the crosshairs from white (when in pspace) ;;; to red (when in active viewport) ;;; Juerg Menzi (defun MeChangeCrosshairColor-vport (Rea Arg / AcaDsp AcaObj LayBco) (if (vl-position (car Arg) '("CVPORT")) (progn (setq AcaObj (vlax-get-acad-object) AcaDsp (vla-get-Display (vla-get-Preferences AcaObj)) LayBco (vlax-variant-value (vlax-variant-change-type (vla-get-GraphicsWinLayoutBackgrndColor AcaDsp) vlax-vbLong ) ) ) ;; ;; Color list: ;; 0 = Black ;; 255 = Red ;; 65535 = Yellow ;; 65280 = Green ;; 16776960 = Cyan ;; 16711680 = Blue ;; 16711935 = Magenta ;; 16777215 = White ;; Set the cursor color to the appropriate value: ;; (vla-put-LayoutCrosshairColor AcaDsp (if (= (getvar "CVPORT") 2) 255 ;Cursor color in Paperspace (MeInvGreyCol LayBco) ) ) ) ) (princ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; (princ) Gary