Bratz2
Assuming no user input (if to be used with a reactor) the following will return the viewport scale, assuming all viewports are the same scale.
(defun VPScale (/ *doc* *vports* *pspace* CurrSpace VP VPScale Scale) (setq *doc* (vla-get-activedocument (vlax-get-acad-object))) (setq CurrSpace (vla-get-MSpace *doc*)) (if (= :vlax-false CurrSpace) (vla-put-MSpace *doc* :vlax-true) (setq Currspace nil) ) (setq VP (vla-get-ActivePViewport *doc*)) (setq VPScale (vla-get-customscale VP)) (if CurrSpace (vla-put-MSpace *doc* :vlax-false) ) (setq Scale (fix (/ 1 VPScale))) (princ (strcat "\nViewport scale = 1:" (rtos Scale 2 0))) (princ)
)
That dimension routine sounds interesting, any chance you could send me a copy?
Steve
Can anyone out there give me an example of how I can get the scale of a vport, and have a dimension style set up with a specific name. I already have a lisp routine for creating the dimensions, but I'd like it to check the viewport scale, and create the name of the dimesnion, based on that scale factor.