TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: BazzaCAD on July 17, 2007, 02:24:23 PM
-
OK, in 2008 as you know we now have AnnoScaleing.
I'd like to update me existing DWG when they're opening to the correct AnnoScale.
Like most people on pre-2008 we used DimScale as our DWG scale, 96 = 1/8", etc...
We only work in Imperial units, so yes I know this doesn't work for Metric (ISO).
Also, I know it's not going to work for Civil scales like 1' = 20'-0"
So the question is, is there a better way of doing this?
Sure would be nice if you could set the "CANNOSCALEVALUE" instead of relying on string....
Here's what I have so far.
(if (not (equal (/ 1 (getvar "DIMSCALE")) (getvar "CANNOSCALEVALUE")))
(setvar "CANNOSCALE" (strcat (rtos (/ 12 (getvar "DIMSCALE")) 4 8) " = 1'-0\""))
)
-
First road block is the above code doesn't work with 1-1/2" = 1'-0" since:
(rtos (/ 12 (getvar "DIMSCALE")) 4 8 )
returns
"1 1/2\""
-
OK here's version 2.0...
(if (not (equal (/ 1 (getvar "DIMSCALE")) (getvar "CANNOSCALEVALUE")))
(progn
(setvar "TILEMODE" 1);; <- can't set AnnoScale in paperspace
(setq txtscale (rtos (/ 12 (getvar "DIMSCALE")) 4 8))
(cond
((= txtscale "1 1/2\"")
(setq txtscale "1-1/2\"")
)
;; room for more issues...
);_ cond
(setq annoscale (strcat txtscale " = 1'-0\""))
(setvar "CANNOSCALE" annoscale)
(princ (strcat "\nYour AnnoScale has been set to: " annoscale "\n\n"))
);_ progn
);_ if