Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Annotation scaling in paperspace

40 REPLIES 40
SOLVED
Reply
Message 1 of 41
miket1210
8026 Views, 40 Replies

Annotation scaling in paperspace

Can anyone tell me how to change the paperspace annotative scale?

40 REPLIES 40
Message 21 of 41
john.vellek
in reply to: miket1210

Hi @miket1210

 

Here is a fix to get the Annoscale of your paperspace layout corrected.

 

  • Select the layout with the bad annoscale.
  • At the command line, paste in the following lisp: 

(setq pspaceVport (ssname (ssget "_x" '((0 . "VIEWPORT") (69 . 1))) 0 ))

(sssetfirst nil (ssadd pspaceVport))

  • In the Properties palette, set Display Locked to No
  • Change the Annotation Scale to 1:1
  • Set the Display Locked to Yes

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.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
Message 22 of 41
clindner
in reply to: john.vellek

@john.vellek,

 

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

Message 23 of 41
john.vellek
in reply to: clindner

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 Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
Message 24 of 41
GrantsPirate
in reply to: john.vellek

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
EXPERT ELITE MEMBER
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.

Message 25 of 41
clindner
in reply to: john.vellek

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:

  • paperspace -> layout(s) -> viewport(s)

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

Message 26 of 41
clindner
in reply to: john.vellek

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)
)

 

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:

  • it shows my initial standard VP scale as 1, even though in the properties palette is shows 1/4"=1'-0".
  • even though the code is assigning acVp1_1, the changed scales don't reflect this. Smiley Frustrated 

 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

Message 27 of 41
john.vellek
in reply to: clindner

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.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
Message 28 of 41
clindner
in reply to: john.vellek

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:

  1. I run CheckPSAnno immediately after opening the drawing, and Standard scale says "1". The layout's anno scale (in properties palette) says 1/4"=1'-0". 
  2. I switch to modelspace and back to paperspace, run it again, and Standard scale says "34". Odd.
  3. I paste your code in, and perform the add'l steps in the palette. Press Esc to release the layout.
  4. Properties still says anno scale is 1/4"=1'-0".
  5. Run CheckPSAnno again and Standard scale says "34".
  6. I switch to modelspace then back to paperspace. Properties now says anno scale is 1:1.
  7. Run CheckPSAnno again and Standard scale says "34". Shouldn't this say "1" now?

Thanks.


Please use the Accept as Solution or Kudo buttons when appropriate

Chris Lindner
CAD Technology Consultant @ onebuttoncad.com
AUGI Board of Directors

Message 29 of 41
clindner
in reply to: john.vellek

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

Message 30 of 41
john.vellek
in reply to: clindner

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.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
Message 31 of 41
clindner
in reply to: john.vellek

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

Message 32 of 41
clindner
in reply to: clindner

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

Message 33 of 41
clindner
in reply to: clindner

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

Message 34 of 41
garrettwilkerson
in reply to: clindner


@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)
Message 35 of 41
clindner
in reply to: garrettwilkerson

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

Message 36 of 41
garrettwilkerson
in reply to: clindner

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.

Message 37 of 41

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.

  1. Copy the code below and save it as a new file.
  2. Change "annoScaleName" to the desired annotation scale name.
  3. Save the file.
  4. APPLOAD
  5. SETALLPSANNO or SETPSANNO
  6. The properties window may not update immediately to reflect the change. Close it and open it again.

 

(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)
)

 

 

Message 38 of 41
aaronlance
in reply to: miket1210

Sorry, I just found this looking for the same answer.

 

You can change the layout scale in the Page Setup manager.

Message 39 of 41
cadffm
in reply to: aaronlance

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] ).

- Sebastian -
Message 40 of 41
aaronlance
in reply to: miket1210

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost