By selecting a scale from the drop down list the border & text styles are scaled per the associated dimscale.
All works great!!!!
(defun c:STA_Scale_TB
( / blk1 siz names dimsc dsty dstydata
) (setq NAMES '
("FULL" "1/4\" = 1'-0\"" "1/2\" = 1'-0\"" "1\" = 1'-0\"" "1-1/2\" = 1'-0\"" "3\" = 1'-0\"" "6\" = 1'-0\""))
) ;not
(exit) ;exit if no dialog ) ;if
"cancel" ;if cancel button pressed
"(done_dialog) (setq userclick nil)" ;close dialog, set flag
) ;action_tile
"accept" ;if O.K. pressed
"(progn
(setq SIZ (get_tile \"selections\")))" ;get list selection
" (done_dialog)(setq userclick T))" ;close dialog, set flag
) ;strcat
) ;action tile
(if userclick
;check O.K. was selected ((= SIZ
"0") (setvar "dimscale" 1));;FULL ((= SIZ
"1") (setvar "dimscale" 48));;1/4" ((= SIZ
"2") (setvar "dimscale" 24));;1/2" ((= SIZ
"3") (setvar "dimscale" 12));;1" ((= SIZ
"4") (setvar "dimscale" 8));;1 1/2" ((= SIZ
"5") (setvar "dimscale" 4));;3" ((= SIZ
"6") (setvar "dimscale" 2));;6" ) ;cond
) ;progn
) ;;if
(command "-layer" "unlock" "TBLK_BORD_LINES" "") (if (setq blk1
(ssget "x" '
((2 .
"TBLK_BORD_CTL,TBLK_ATT_CTL")))) (command "scale" blk1
"" "0,0" dimsc
) )
(if (assoc 40 dstydata
) ; [because not included in data if default 1.0] )
)
(command "dimstyle" "R" "ORDINATE_FRAC") )
(command "-layer" "lock" "TBLK_BORD_LINES" "") (command "-layer" "Filter" "Set" "Stations Standard Layers" "exit" "") (command "layer" "M" "LINE1" "C" "YELLOW" "LINE1" "")
(command ".style" "Standard" "ipco.shx" (* 1.000 dimsc
) "0.85" "0" "n" "n" "n") (command ".style" "L080" "ipco.shx" (* 0.0781 dimsc
) "0.85" "0" "n" "n" "n") (command ".style" "L100" "ipco.shx" (* 0.0938 dimsc
) "0.85" "0" "n" "n" "n") (command ".style" "L120" "ipco.shx" (* 0.1094 dimsc
) "0.85" "0" "n" "n" "n") (command ".style" "L140" "ipco.shx" (* 0.1406 dimsc
) "0.85" "0" "n" "n" "n") (command ".style" "L175" "ipco.shx" (* 0.1563 dimsc
) "0.85" "0" "n" "n" "n") (command ".style" "L200" "ipco.shx" (* 0.1719 dimsc
) "0.85" "0" "n" "n" "n") (command ".style" "L240" "ipco.shx" (* 0.2187 dimsc
) "0.85" "0" "n" "n" "n") (command ".style" "Ls080" "ipco.shx" (* 0.0781 dimsc
) "0.85" "20" "n" "n" "n") (command ".style" "Ls100" "ipco.shx" (* 0.0938 dimsc
) "0.85" "20" "n" "n" "n") (command ".style" "Ls120" "ipco.shx" (* 0.1094 dimsc
) "0.85" "20" "n" "n" "n") (command ".style" "Ls140" "ipco.shx" (* 0.1406 dimsc
) "0.85" "20" "n" "n" "n") (command ".style" "Ls175" "ipco.shx" (* 0.1563 dimsc
) "0.85" "20" "n" "n" "n") (command ".style" "Ls200" "ipco.shx" (* 0.1719 dimsc
) "0.85" "20" "n" "n" "n") (command ".style" "Ls240" "ipco.shx" (* 0.2187 dimsc
) "0.85" "20" "n" "n" "n") (command ".style" "PEN0" "ipco.shx" (* 0.0625 dimsc
) "0.85" "0" "n" "n" "n") (command ".style" "PEN1" "ipco.shx" (* 0.0781 dimsc
) "0.85" "0" "n" "n" "n") (command ".style" "PEN2" "ipco.shx" (* 0.0125 dimsc
) "0.85" "0" "n" "n" "n") (command ".style" "PEN2s" "ipco.shx" (* 0.1000 dimsc
) "0.85" "0" "n" "n" "n") (command ".style" "PEN3" "ipco.shx" (* 0.1875 dimsc
) "0.85" "0" "n" "n" "n") (command ".style" "PEN4" "ipco.shx" (* 0.2500 dimsc
) "0.85" "0" "n" "n" "n") (command ".style" "PEN5" "ipco.shx" (* 0.3125 dimsc
) "0.85" "0" "n" "n" "n")
);;end defun
I have this piece of code (Lee Mac magic) that looks at the attribute tag, checks what it says and does stuff...
(defun lm:getattributevalue
(blk tag
/ val enx
) )
)
)
(setq ss
(ssget "x" '
((0 .
"INSERT") (2 .
"TBLK_ATT_CTL") (66 .
1)))) (setq attvalue
(LM:GetAttributeValue
(ssname ss
0) "DRAWINGSCALE")) (cond ((wcmatch (strcase attvalue
) "NONE");;; REPLACE THIS SO THAT IT POPULATES THE attvalue WITH THE SELECTION FROM THE DROP DOWN MENU. "do stuff here"
);;end if
);;end cond
I want to populate the "DrawingScale" Tag in the attribute with whatever the selection was in the drop down list.
Is this possible? Seems to me it should be.
I'm not sure the LM:GetAttributeValue even needs to be used. I'm pretty sure it doesn't. It's just my first thought
My guess?!?!?
Use the userclick function and replace
with something akin to editing the "DrawingScale" Tag.
If anyone has a nudge that would be great. Mostly I'm hoping for some search suggestions or "look at this". If I get stumped, I'll be back here.