Hi,
I have some experience with AutoLisp but am new to Reactors and "vla-" functions.
I want to execute the following lisp within a reactor callback:
(if (tblsearch "dimstyle" "my_dimstyle")(command "dimstyle" "restore" "my_dimstyle"))
but of course I cannot use the "command" function in a reactor.
I would like a "vla-" alternative to the above please. I think I need to use "vla-put-activedimstyle" but I cannot work out how to make it work.
Thanks
Phill
PS Here is the callback function I want to use it in:
Code:
(defun ppn_reactor_tm (ppn_reactor_name ppn_layout_name / MS_SC)
(if (= (setq *SC* (getvar "dimscale")) 0.0)
(setq *SC* 1)
)
(if (= (car ppn_layout_name) "Model")
(progn
(if (/= (setq MS_SC (getvar "userr1")) 0.0)
(progn
;;; Insert dimstyle restore here
(setvar "dimscale" MS_SC)
(setq *SC* (getvar "dimscale"))
(setvar "ltscale" (* *SC* 7.62))
)
(progn
;;; Insert dimstyle restore here
(setvar "dimscale" *SC*)
(setvar "ltscale" (* *SC* 7.62))
)
)
)
(progn
(setvar "userr1" (getvar "dimscale"))
;;; Insert dimstyle restore here
(setvar "dimscale" 1.0)
(setq *SC* 1.0)
(setvar "ltscale" (* *SC* 7.62))
(if (/= (getvar "PSLTSCALE") 1)
(alert "PSLTSCALE is not set to 1.\nPlease check.")
)
)
)
(princ)
)
(vlr-miscellaneous-reactor
nil
'((:vlr-layoutSwitched . ppn_reactor_tm))
)