- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi! Running into an interesting situation when trying to scale the viewport of my layout with LISP.
Quick rundown: I'm trying to automate scaling the viewport to 1" = 750' by calling a custom command made with LISP. When doing this manually usingmouse and keyboard, I noticed in the command line that it uses the command _.MSPACE to enter the model space of the viewport, _CANNOSCALE to adjust the scale of the viewport to the predefined scales on the list, and then ._PSPACE to exit the viewport. Seems simple.
Here's what the command line looks like:
Command: _.MSPACE
Command: _CANNOSCALE
Enter new value for CANNOSCALE <"1" = 500'">: 1" = 750'
Command: _.PSPACE
If I click back into the viewport and type VPSCALE, the scale corresponds with the value chosen from the list. Ex: the command line will show PS:MS == 1:750 for this example.
Now I want to apply this into LISP code. Based on what the command line was showing while doing this manually, I created the following:
(defun c:scaleadjustment()
(setq desiredscale "1\" = 750'")
(command "._mspace")
(command "_cannoscale" desiredscale)
(command "._pspace")
(princ)
)
Upon calling the command, the command line looks virtually the same:
Command: SCALEADJUSTMENT
Command: ._mspace
Command: _cannoscale
Enter new value for CANNOSCALE <"1" = 500'">: 1" = 750'
Command: ._pspace
However, it does not increase or decrease the zoom of my viewport like it would if I am using the button at the bottom of the screen and clicking the corresponding value. If I type in _CANNOSCALE after calling the command, it has the value CANNOSCALE <1" = 750'">: , but if I type VPSCALE it will show the initial scale value. Therefore, when using _CANNOSCALE in LISP, it doesn't automatically match the viewport scale with the updated annotation scale.
There is a button to the right of the scale value for this, but from what I can (or can't) find, there is not a command to queue this. Does anyone know how it can be replicated in LISP, or if there is a different way to tackle this?
Really appreciate any insight!
Solved! Go to Solution.