Reactor Help

Bratz2

Usenet Archive
Joined
Jul 2, 2003
Messages
35
Reaction score
0
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.
 
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.
 
I'm not sure if I can send you a copy, as it wasn't written by me. But I'll check with the individual, and see if it alright with them. I don't want to step on anyone's toes. I'm gonna try what you suggested, and see what happens. But one more question.... What if there are multiple viewports, then using reactors would not be the way to go, is that correct.
 
Depends on what you want to do really.
If you want to create a dimstyle for a new viewport when it is created then a reactor is the tool for the job. If you don't mind a bit of user interface you could select the viewports manually & create a dimstyle to suit each one. What exactly is it you want to achieve?

I'm not sure if I can send you a copy, as it wasn't written by me. But I'll check with the individual, and see if it alright with them. I don't want to step on anyone's toes. I'm gonna try what you suggested, and see what happens. But one more question.... What if there are multiple viewports, then using reactors would not be the way to go, is that correct.
 
What if the routine created the dimension based on the current "Active" viewport, would that be the way to go? If so what would the result be if the user were in let's say, paperspace with no Active viewports, but still needed to generate a dimension scale?
 
"be
careful when working within viewports a lot of things happen in between." Could you explain a bit more?
 
I'm trying to get it to create a dimension style based on the user being able to select any single viewport. My concern is... What if there is no viewport, or what if the user is in Modelspace already? If the user is still in Modelspace The if possible i'd like them to be able to type in a scale much like the routine I'm already using.
 

Latest threads

Back
Top