Author Topic: How do you set the StandardScale & AnnoScale of a viewport  (Read 2832 times)

0 Members and 1 Guest are viewing this topic.

BazzaCAD

  • Guest
How do you set the StandardScale & AnnoScale of a viewport
« on: September 23, 2008, 07:52:16 PM »
Sorry I've been out of the loop fro way too long.
I'm trying to set the StandardScale & the AnnoScale of a viewport to the same scale.
If I change the "Viewport Scale" from the drop down list on the status bar to something like 3/4" = 1'-0"
Then run
Code: [Select]
(vla-get-standardscale
  (vla-get-activepviewport (vla-get-activedocument (vlax-get-acad-object)))
)
I get 14
How do I get the list of the StandardScale codes so I know 14 = 3/4" = 1'-0" or what is the code for 1" = 1'-0" ?

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: How do you set the StandardScale & AnnoScale of a viewport
« Reply #1 on: September 24, 2008, 07:11:28 AM »
Don't know if there is a better way but this is what I came up with:

Code: [Select]
;;;Return CANNOSCALE in drawing units
;;;(jb:Cannoscale)
(defun jb:Cannoscale (/ annoscale ret)
  (setq annoscale (vlax-invoke
                    (vla-get-ActiveDocument (vlax-get-acad-object))
                    'getvariable
                    "CANNOSCALEVALUE"
                    )
        ret       (/ 12 (* annoscale 12.0))
        )
  ret
  )

Hope this helps.
James Buzbee
Windows 8

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: How do you set the StandardScale & AnnoScale of a viewport
« Reply #2 on: September 24, 2008, 08:46:57 AM »
You may find this useful.
Routine excepts any of these formats: 1/4, 48, 1:20
http://www.theswamp.org/index.php?topic=18143.msg297216#msg297216
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ronjonp

  • Needs a day job
  • Posts: 7529
Re: How do you set the StandardScale & AnnoScale of a viewport
« Reply #3 on: September 24, 2008, 11:54:11 AM »
James,

Is there an advantage to grabbing the variable using vlsp over using (/ 12 (* (getvar 'cannoscalevalue) 12.0))?

Ron

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: How do you set the StandardScale & AnnoScale of a viewport
« Reply #4 on: September 24, 2008, 12:41:56 PM »
 :-D

I'm laughing because that was written in the "heat of battle" if you will.  I had to feverishly work to get a bunch of the new features incorporated into all my stuff, so apparently at the time I was working heavily in activex mode.

So, no, probably no advantage at all.
James Buzbee
Windows 8

ronjonp

  • Needs a day job
  • Posts: 7529
Re: How do you set the StandardScale & AnnoScale of a viewport
« Reply #5 on: September 24, 2008, 12:51:08 PM »
Good to know :)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

BazzaCAD

  • Guest
Re: How do you set the StandardScale & AnnoScale of a viewport
« Reply #6 on: September 25, 2008, 02:33:37 PM »
You may find this useful.
Routine excepts any of these formats: 1/4, 48, 1:20
http://www.theswamp.org/index.php?topic=18143.msg297216#msg297216


Thx CAB,
That looks like it will do the trick.