Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Detect a dimstyle change in a reactor

2 REPLIES 2
Reply
Message 1 of 3
YM-Architectes
277 Views, 2 Replies

Detect a dimstyle change in a reactor

Hi, I need ot append events when the dimstyle is change using the AutoCAD dimstyle popup list, but don't know which reactoer to use. I tried with Comman begin and end, and Sysvawill change and changed, but they don't detect the dimstyle changes.

 

Which reactor I should use?

 

Thanks

 

Marcel

2 REPLIES 2
Message 2 of 3
Moshe-A
in reply to: YM-Architectes

Marcel,

 

What is the action you would like to take after dimstyle update?

 

what about saving the dimvars before dimstyle is started (:vlr-commandWillStart)

and compare them after dimstyle is done (:vlr-commandEnded)

 

Moshe

 

Message 3 of 3
Hallex
in reply to: YM-Architectes

Try this quick sample

(vl-load-com)
;; credits to SMADSEN
(if (not *react*)
  (setq	*react*
	 (vlr-command-reactor
	   nil
	   '((:vlr-commandWillStart . startCommand)
	     (:vlr-commandEnded . endCommand)
	     (:vlr-commandCancelled . cancelCommand)
	     (:vlr-commandFailed . failedCommand)
	    )
	 )
  )
)

(defun startCommand (calling-reactor startcommandInfo / BGN )
  (setq BGN (nth 0 startcommandInfo))
  (if (eq BGN "DIMSTYLE")
    (setvar "modemacro" "Current Dimstyle:  $(getvar,dimstyle)")
  )
)

(defun endCommand (calling-reactor endcommandInfo / END)
  (setq END (nth 0 endcommandInfo))
  (setq OLD (getvar 'dimstyle))

  (if (eq END "DIMSTYLE")
    (setvar "modemacro" "Current Dimstyle:  $(getvar,dimstyle)")
  )

)

(defun cancelCommand (calling-reactor cancelcommandInfo / CNL)
  (setq CNL (nth 0 cancelcommandInfo))
  (if (eq CNL "DIMSTYLE")
    (setvar "modemacro" "Current Dimstyle:  $(getvar,dimstyle)")
  )
)

(defun failedCommand (calling-reactor failedcommandInfo / FLD)
  (setq FLD (nth 0 failedcommandInfo))
  (if (eq FLD "DIMSTYLE")
    (setvar "modemacro" "Current Dimstyle:  $(getvar,dimstyle)")
  )
)

 

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost