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.
@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 ?
Something like that, but maybe a more direct command.
I want the name and scale ratio adjust automatically.
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) )