Well, I've been enjoying the ease of Annoscale Objects. I've been able to do away with many reactors that dealt with dimscale, textsize, ltscale, layout switching etc. The only thing that still bothers me is the 'MSLTSCALE sysvar, that lets CANNOSCALE control linetype scale doesn't work at all with our standard layers and linetypes. So I started investigating how to controll LineType scale when the CANNOSCALE sysvar changes. CANNOSCALE command returns SETVAR in a VLR-Command-Reactor event! How can we use that?? So I came up with the clever way of checking the command prompt to see what's been called:
snip:
((if (vl-string-search "CANNOSCALE" (getvar "lastprompt"))
(progn
(setq DwgDimScale (jb:GetADTVar 40)
Doc (vla-get-activedocument (vlax-get-acad-object)))
(vlax-invoke
Doc
"setvariable"
"ltscale"
(* 0.5 DwgDimScale))
(vla-regen Doc acActiveViewport)
)))
Now the AutoCAD dimscale doesn't get changed when CANNOSCALE does, but the ADT Dimscale variable does. I wrote this little routine for extracting all kind of info from the AECVARS dictionary:
;;; ADT Variable Function ;
;;; Layer Standard Drawing (jb:GetADTVar 5) ;
;;; Layer Standard (jb:GetADTVar 9) ;
;;; Drawing Scale(jb:GetADTVar 40) ;
;;; Annotation size (jb:GetADTVar 42) ;
;;; ;
;;; Return ADT Variable Value ;
(defun jb:GetADTVar (var / dict vars ret)
;check to see if the dict exists, if not initialize it . . .
(if (not (cdar (dictsearch (namedobjdict) "AEC_VARS")))
(aeclayerkeylist))
(setq dict (dictsearch
(cdar (dictsearch (namedobjdict) "AEC_VARS"))
"AEC_VARS_DWG_SETUP")
vars (member '(100 . "AecDbVarsDwgSetup") dict)
ret (cdr (assoc var vars)))
ret)
Anyway, I thought some of you would enjoy seeing a severely hacked work-around - in a reactor no less!
If anyone wants to see the whole reactor code just ask - it's pretty straight forward though.