Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Lisp to Add scales to list scales

3 REPLIES 3
Reply
Message 1 of 4
jjorovi
1651 Views, 3 Replies

Lisp to Add scales to list scales

Hi everybody!
Someone could help me to create a code to add scales to the scale’s list?
I just want to have the necessary scales, so don’t want to add to the template.
The command function is basically to allow me type the value of the scale and based on that, adjust the properties of the scale. (Name appearing in scale list - Paper Milimeters - Drawing Meters)

Example:

>Command line: setscale

>type the value of the scale to create: 50

set 1:50 to default

 


Thanks for any help.

3 REPLIES 3
Message 2 of 4
Ajilal.Vijayan
in reply to: jjorovi


@jjorovi wrote:

The command function is basically to allow me type the value of the scale and based on that, adjust the properties of the scale. (Name appearing in scale list - Paper Milimeters - Drawing Meters)


Are you referring to -SCALELISTEDIT command ?

 

scale.JPG

 

Message 3 of 4
jjorovi
in reply to: Ajilal.Vijayan

Something like that, but maybe a more direct command.

I want the name and scale ratio adjust automatically.

Message 4 of 4
jjorovi
in reply to: jjorovi

Maybe, this code help to start.

 

 

(defun set-annoscale (name ratio / dlst test)
(if (/= (strcase name) (strcase (getvar "CANNOSCALE")))
(progn
(setq dlst (dictsearch (namedobjdict) "ACAD_SCALELIST")
test nil
)
(while dlst
(cond
((/= (caar dlst) 350) (setq dlst (cdr dlst)))
((= (strcase (cdr (assoc 300 (entget (cdar dlst))))) (strcase name))
(setq dlst nil test T)
)
(T (setq dlst (cdr dlst)))
)
)
(if (not test) (command "-SCALELISTEDIT" "Add" name ratio "Exit"))
(setvar "CANNOSCALE" name)
)
)
(princ)
)

 

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

Post to forums  

Autodesk Design & Make Report

”Boost