Can anyone tell me how to change the paperspace annotative scale?
Solved! Go to Solution.
Solved by john.vellek. Go to Solution.
Hi @miket1210
Here is a fix to get the Annoscale of your paperspace layout corrected.
(setq pspaceVport (ssname (ssget "_x" '((0 . "VIEWPORT") (69 . 1))) 0 ))
(sssetfirst nil (ssadd pspaceVport))
Please try this and let me know if it works for you.
Please select the Accept as Solution button if my post solves your issue or answers your question.
I gave it a try but didn't see a change.
Just curious, how would changing a viewport's scale fix an issue with paper space?
Please use the Accept as Solution or Kudo buttons when appropriate
Chris Lindner
CAD Technology Consultant @ onebuttoncad.com
AUGI Board of Directors
Hi @clindner,
The viewport is the Paperspace Viewport so it will allow setting the annotation scale for paperspace.
I repeated my proposed steps on the attached file and was able to change the 1/8"=1'-0" annotation scale on the first layout to 1:1.
Please select the Accept as Solution button if my post solves your issue or answers your question.
John.V,
I tried your posted solution on the drawing the OP provided and it worked as advertised. I have saved that text on my hard drive in case I ever have one of my files do that again.
GrantsPirate
Piping and Mech. Designer
Always save a copy of the drawing before trying anything suggested here.
----------------------------------------------------------------------------
If something I wrote can be interpreted two ways, and one of the ways makes you sad or angry, I meant the other one.
HI, @john.vellek,
I'll give another try when I'm back in the office tomorrow. Fingers crossed!
Can the entire process be handled via Autolisp (rather than requiring manual interaction with the palette)? And is there a way to check the layout's scale to see if it is 1:1 or not? I already have a "layout switched" reactor, so I would love to be able to add this code so that "bad" layouts are transparently fixed for the users.
I may be getting confused by our use (and definitions) of the terms paperspace, layouts, and viewports. You used the phrase "paperspace viewports". I see them as a hierarchy:
And to complicate things, from a programming vantage point (i.e. "under the hood"), layouts are a block! 🙂
Please clarify.
Thanks!
Please use the Accept as Solution or Kudo buttons when appropriate
Chris Lindner
CAD Technology Consultant @ onebuttoncad.com
AUGI Board of Directors
Good morning, @john.vellek.
It does appear to work (which I'm ecstatic about!), but I hit a few glitches:
I tried to automate it using the code below, but I'm missing something. It doesn't return an error, but it doesn't work as expected. (The add'l princ statements were added just so I could see what was happening.)
(defun C:FixLayout (/ pspaceVport pspaceVpObj)
(setq pspaceVport (ssname (ssget "_x" '((0 . "VIEWPORT") (69 . 1))) 0 ))
(setq pspaceVpObj (vlax-ename->vla-object pspaceVport))
(princ "\nInitial scales: ")
(princ "\n - Standard: ")(princ (vla-get-standardscale pspaceVpObj))
(princ "\n - Standard2: ")(princ (vla-get-standardscale2 pspaceVpObj))
(princ "\n - Custom: ")(princ (vla-get-customscale pspaceVpObj))
(vla-put-DisplayLocked pspaceVpObj :vlax-false)
(vla-put-standardscale pspaceVpObj acVp1_1)
(vla-put-standardscale2 pspaceVpObj acVp1_1)
(vla-put-customscale pspaceVpObj 1.0)
(vla-put-DisplayLocked pspaceVpObj :vlax-true)
(princ "\nChanged scales: ")
(princ "\n - Standard: ")(princ (vla-get-standardscale pspaceVpObj))
(princ "\n - Standard2: ")(princ (vla-get-standardscale2 pspaceVpObj))
(princ "\n - Custom: ")(princ (vla-get-customscale pspaceVpObj))
(textscr)
(princ)
)
Here are the results when I run it in my test drawing (attached):
Initial scales: - Standard: 1 - Standard2: 1 - Custom: 0.999535 Changed scales: - Standard: 34 - Standard2: 2 - Custom: 1.0
A couple interesting notes:
I'm encouraged with the progress we're (you're) making though. Nice work!
Please use the Accept as Solution or Kudo buttons when appropriate
Chris Lindner
CAD Technology Consultant @ onebuttoncad.com
AUGI Board of Directors
HI @clindner,
I went through my steps on your last file and it seemed to work on my side. Please take a look and see if it misbehaves for you now.
Please select the Accept as Solution button if my post solves your issue or answers your question.
HI, @john.vellek.
I don't disagree that it's working. It's just that AutoCAD is giving mixed results initially. It seems like I have to go through a few additional steps to get the layout and the properties palette to be in sync with each other. So it works, but I can't tell that it worked until I do a few add'l steps. I've posted another screencast for reference.
Note: I created a "CheckPSAnno" routine (attached) to check the various scales before, during & after pasting the process.
Here's a play-by-play of the video:
Thanks.
Please use the Accept as Solution or Kudo buttons when appropriate
Chris Lindner
CAD Technology Consultant @ onebuttoncad.com
AUGI Board of Directors
Hi, @john.vellek.
Just wanted to follow up on this issue. I continue to get consistent (and confusing) results using the recommended "solution". Latest Screencast posted here.
I am still very interested in automating this process, as mentioned in this post.
Thanks, again!
Please use the Accept as Solution or Kudo buttons when appropriate
Chris Lindner
CAD Technology Consultant @ onebuttoncad.com
AUGI Board of Directors
Hi Chris,
I wish I could actually deduce how the annotation scale gets changed in the first place as that might help in your Lisp routine. I suggest adding a post in the Customization forum on this issue as the Community might be able to offer more insight on error checking this issue as the routine runs. The small bit of code that I was able to provide seems to work on my side but I only have a couple of drawings to test on.
If you like, you can also provide me with some more (different) samples to work with as well.
Good idea.
Done. I've attached to that post another sample drawing for testing.
Please use the Accept as Solution or Kudo buttons when appropriate
Chris Lindner
CAD Technology Consultant @ onebuttoncad.com
AUGI Board of Directors
All,
FWIW, @Ranjit_Singh2 posted code that will correct this issue! Works like a charm!
So, until we can determine why it's happening in the first place, this will help a lot.
Please use the Accept as Solution or Kudo buttons when appropriate
Chris Lindner
CAD Technology Consultant @ onebuttoncad.com
AUGI Board of Directors
Just in case someone stumbles across this thread, Ranjit's code did not fix the issue after all unfortunately. As of this post, there's still no known fix.
Please use the Accept as Solution or Kudo buttons when appropriate
Chris Lindner
CAD Technology Consultant @ onebuttoncad.com
AUGI Board of Directors
@clindner wrote:
Good morning, @john.vellek.
It does appear to work (which I'm ecstatic about!), but I hit a few glitches:
- I've had it lock up AutoCAD a few times. The last time was when I was changing "Display Locked" to "No". I'll keep trying it to see if I can determine a pattern.
- For some reason, the annotation scale isn't updating in the Properties palette. If I re-paste your code in, it shows 1:1, but as soon as I hit Esc to release the paperspace viewport, it returns to the bad scale (in my case, 1/4"=1'-0"). If, however, I switch to a different layout and then back, the scale then shows correctly.
I tried to automate it using the code below, but I'm missing something. It doesn't return an error, but it doesn't work as expected. (The add'l princ statements were added just so I could see what was happening.)
(defun C:FixLayout (/ pspaceVport pspaceVpObj)
(setq pspaceVport (ssname (ssget "_x" '((0 . "VIEWPORT") (69 . 1))) 0 ))
(setq pspaceVpObj (vlax-ename->vla-object pspaceVport))
(princ "\nInitial scales: ")
(princ "\n - Standard: ")(princ (vla-get-standardscale pspaceVpObj))
(princ "\n - Standard2: ")(princ (vla-get-standardscale2 pspaceVpObj))
(princ "\n - Custom: ")(princ (vla-get-customscale pspaceVpObj))
(vla-put-DisplayLocked pspaceVpObj :vlax-false)
(vla-put-standardscale pspaceVpObj acVp1_1)
(vla-put-standardscale2 pspaceVpObj acVp1_1)
(vla-put-customscale pspaceVpObj 1.0)
(vla-put-DisplayLocked pspaceVpObj :vlax-true)
(princ "\nChanged scales: ")
(princ "\n - Standard: ")(princ (vla-get-standardscale pspaceVpObj))
(princ "\n - Standard2: ")(princ (vla-get-standardscale2 pspaceVpObj))
(princ "\n - Custom: ")(princ (vla-get-customscale pspaceVpObj))
(textscr)
(princ)
)
The only problem with John Vellek's code is that it gets the first paper-space viewport and not necessarily the paper-space viewport for the active sheet. However even after making the annotation scale changes there is no difference between the properties of the vlax-object (using vlax-dump-object) or of the entity definition (using entget). Therefore I don't think that the annotation scale property is exposed this way. I cannot figure out how to change this property automatically however John Vellek's steps do work. Here is the modified AutoLISP that at least allows changes to the paperspace annotation scale for each sheet reliably.
(defun C:CPSANNO (/ ctab ss psvp) (if (not alert_once) (progn (alert (strcat "\n(1) In the properties palette, set 'Display Locked' to 'No'" "\n(2) Change the 'Annotation Scale' to '1:1'" "\n(3) Reset the 'Display Locked' back to 'Yes'" "\n(4) Press 'Esc' to end selection" "\n(5) Before the change becomes visible, the active layout must be" "\n switched to any other layout, and then changed back." ) ) (setq alert_once 1) ) ) (setq ctab (getvar "ctab")) (setq ss (ssget "_x" (list '(0 . "VIEWPORT")(cons 410 ctab)'(69 . 1)))) (setq psvp (ssname ss 0)) (sssetfirst nil (ssadd psvp)) ) (prompt "\nEnter CPSANNO to allow changes to the PSPACE annotation scale") (princ)
Thanks, @garrettwilkerson! That appears to work as described (having done only a couple tests).
I would change #2 to:
Change both the 'Annotation Scale' and 'Standard Scale' to '1:1'"
I'm too lazy to have to manually do all those steps, though. Lol! And I don't want my users to have to do this manually for every effected layout in every drawing! I'm hoping that @john.vellek & the magicians at Autodesk can give us a piece of code that can be added to the S::STARTUP (to make these self-healing) or at least stand-alone command that doesn't require multiple manual steps. (No offense. I'm just lazy, remember?!)
I think we're getting close, though. Thanks for the post!
Chris
Please use the Accept as Solution or Kudo buttons when appropriate
Chris Lindner
CAD Technology Consultant @ onebuttoncad.com
AUGI Board of Directors
Thanks clindner,
I thought about putting the change to standard scale in there but for me the standard scale changes back to its original value. I agree that we are not all the way there yet and that we are getting closer. Perhaps someone who is better with AutoLISP could automate the process. If I knew how to make the change I could certainly write a loop to do it on every layout but I can't figure out how to automatically set the scale. I will do a bit more digging when I have some time.
Below are two custom commands to change the paperspace annotation scale. The first command (SETALLPSANNO) will change the annotation scale for all layouts/paperspaces. The second command (SETPSANNO) will change the annotation scale of only the active layout/paperspace.
(vl-load-com) ; load support for ActiveX
(defun C:SETALLPSANNO (/ annoScaleName)
(setq annoScaleName "1\" = 1'") ; <----- Change this to the desired annotation scale name. Remember to escape certain characters such as quotation marks.
(vlax-for layout (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object))) ; loop through each layout in the layouts collection
(if (/= (vla-get-name layout) "Model") ; don't apply to model space layout
(setpropertyvalue
(vlax-vla-object->ename
(vla-item
(vla-get-block layout) ; get the block collection in the layout
0 ; get the first (nth 0) item, which should be the paperspace
)
) ; convert the VLA object to ename
"AnnotationScaleName" ; name of property to update
annoScaleName ; new property value (as defined above)
)
)
)
(princ)
)
(defun C:SETPSANNO (/ annoScaleName)
(setq annoScaleName "1\" = 1'") ; <----- Change this to the desired annotation scale name. Remember to escape certain characters such as quotation marks.
(if (and (= (getvar 'TILEMODE) 0) (= (getvar 'CVPORT) 1)) ; check if actively in paperspace and not in viewport
(setpropertyvalue
(vlax-vla-object->ename
(vla-item
(vla-get-paperspace (vla-get-activedocument (vlax-get-acad-object))) ; get the block collection of the active paperspace/layout
0 ; get the first (nth 0) item, which should be the paperspace
)
) ; convert the VLA object to ename
"AnnotationScaleName" ; name of property to update
annoScaleName ; new property value (as defined above)
)
(princ "\n** Command not valid in model space or viewport **") ; error message if in model space or inside viewport
)
(princ)
)
Sorry, I just found this looking for the same answer.
You can change the layout scale in the Page Setup manager.
Hi,
if this is the solution for your problem (You can change the layout scale in the Page Setup manager), it is offtopic.
Sorry. In this thread they are talked about the annotation scale and you can't change the annotation scale for paperspace in your pagesetup, just the plotscale - like in PLOT dialog too (don't forget to [apply to layout] ).
It seems you're correct. I don't know what I did differently last week, but I thought I was able to change the layout scale in page setup and it was updating the paperspace viewport annotative scale. Maybe there's a setting that relates the two, but I haven't been able to find it.
SetPSanno crashes in AutoCAD 2024 with an ADS request error. Maybe a drawing setting, or something changed.