AutoCAD Architecture Customization

Reply
Distinguished Contributor
rellison
Posts: 191
Registered: ‎09-05-2002
Message 1 of 2 (308 Views)

Set Annotation Scale via AutoLISP

308 Views, 1 Replies
04-12-2007 03:08 PM
I have a oft-used AutoLISP macro from ADT 2007 that sets the drawing scale via "_AECSETDWGSCALE" to a decimal value (such as 48.0 for 1/4"=1'-0" scale) that represents the working scale selected by the user.
Now if I understand correctly, this will no longer work in ACA 2008. In the new system, given the decimal value, I must first create a scale in the scale list and then set the value of CANNOSCALE to the name of that scale. is this correct?
I'm not sure I like this new system. Why must the variable "CANNOSCALE" be limited to a list of predefined scales? Why not just set it to a decimal value and there you go?
On a related topic, there is an option under "AECDWGSETUP" to "Automatically Create Dimscale Override". Well, I don't recommend using dimension overrides for mixing scales in a drawing. I think that creating separate dimension styles is more robust. Would it be wise to have an option to "Automatically Create New Dimension Style" when changing annotation scales? I want to write a macro that does exactly this, if I am able.

Richard Ellison
GSSTJ Architects
*Ken Krupa
Message 2 of 2 (308 Views)

Re: Set Annotation Scale via AutoLISP

04-19-2007 05:52 PM in reply to: rellison
I can't answer why, but this might help. Here is a function for converting a
scale (real) to a string:
(defun kcs_scaletos (scale)
(if (> (getvar "lunits") 3)
(if (= (fix (/ scale 10.0))(/ scale 10.0))
(if (= (fix (/ scale 12.0))(/ scale 12.0))
; Engineering [ex: 480 => 1" = 30']
(strcat "1\" = " (rtos (/ scale 12.0) 2 0) "'")
; Bogus (display as ratio)
(strcat "1 = " (rtos scale 2 0))
)
; Architectural [ex: 1/16" = 1'-0"]
(strcat (rtos (/ 12.0 scale)) " = " (rtos 12.0))
)
; Decimal [ex: 1=50]
(if (= (getvar "measurement") 1)
(strcat "1:" (rtos scale 2 0))
(strcat "1 = " (rtos scale 2 0))
)
)
)

Then you can do something like
(setvar "cannoscale" (kcs_scaletos 48))


Ken Krupa
Krupa CADD Solutions
www.krupacadd.com
KCS Productivity Pack for AEC
Autodesk Authorized Developer

wrote in message news:5550610@discussion.autodesk.com...
I have a oft-used AutoLISP macro from ADT 2007 that sets the drawing scale
via "_AECSETDWGSCALE" to a decimal value (such as 48.0 for 1/4"=1'-0" scale)
that represents the working scale selected by the user.
Now if I understand correctly, this will no longer work in ACA 2008. In the
new system, given the decimal value, I must first create a scale in the
scale list and then set the value of CANNOSCALE to the name of that scale.
is this correct?
I'm not sure I like this new system. Why must the variable "CANNOSCALE" be
limited to a list of predefined scales? Why not just set it to a decimal
value and there you go?
On a related topic, there is an option under "AECDWGSETUP" to "Automatically
Create Dimscale Override". Well, I don't recommend using dimension
overrides for mixing scales in a drawing. I think that creating separate
dimension styles is more robust. Would it be wise to have an option to
"Automatically Create New Dimension Style" when changing annotation scales?
I want to write a macro that does exactly this, if I am able.

Richard Ellison
GSSTJ Architects

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community