I'm working on a routine that'll set Layer, Dimstyle, & Textstyle to our company standards for a given architectural scale via a simple dialog box. It more or less works, but what I'd like is for it to initialize to 1" scale the first time it's run in a drawing session, and then as the user changes to another scale, have that setting stick in the dialog box. Can't quite figure it out. Also, <StickingMyNeckWayOut> I'd appreciate any advice/opinions on my code. I know it's not the most elegant, or streamlined, but I gotta walk before I can run. I have the opinion that this may be easier (read: more streamlined) in VB(A?), but I'm just getting into LISA now....er, LISP that is, and wanna get a good handle on IT first.
// <SETSCALE.DCL>
// Created: <JAN. 2005>
// Modified: <>
//
//
//
// This DCL routine defines a dialog box to select a scale from user input
// and sets the Dimstyle, Textstyle, and Layer to the corresponding
// values.
//
// It is designed to run with SETSCALE.LSP
//
SETSCALE : dialog {
label = "Set Scale";
: text {
key = "t1";
value="Select to set Dimension, Text, and Layer Settings.";
width=40;
}
:boxed_row {
: radio_column {
: radio_button {
key = "fs";
label ="Full Scale";
}
: radio_button {
key = "hs";
label ="Half Scale";
}
: radio_button {
key="3s";
label ="3\"=1'-0\"";
}
: radio_button {
key="15s";
label ="1 1/2\"=1'-0\"";
}
: radio_button {
key = "1s";
label ="1\"=1'-0\"";
}
} //end of radio_column
: radio_column {
: radio_button {
key = "34s";
label ="3/4\"=1'-0\"";
}
: radio_button {
key = "12s";
label ="1/2\"=1'-0\"";
}
: radio_button {
key="38s";
label ="3/8\"=1'-0\"";
}
: radio_button {
key="14s";
label ="1/4\"=1'-0\"";
}
} //end of radio_column
} //end of boxed_row
:text {
value = " ...tap, tap, tap... ";}
ok_cancel;
} //end of dialog
Here's the lisp. I don't know if all the 'set_tile' calls are right. I tried a few different things with 'em and they don't seem to have much effect.
;
;<SETSCALE>.lsp
;Created: <JAN. 2005>
;Modified: <>
;
;This LISP routine uses a dialog box to select a scale from user input
; and sets the Dimstyle, Textstyle, and Layer to the corresponding
; values.
;
;
;
(defun C:SETSCALE (/ $VALUE DCL_ID fS fS 3s 15s 1s 34s 12s 38s 14s)
;DEFINE LOCAL VARIABLES
(setvar "cmdecho" 0)
;Loads dialog box
(setq dcl_id (load_dialog "SETSCALE.dcl"))
(if (not (new_dialog "SETSCALE" dcl_id))
(exit)
)
;(set_tile "1s" "1")
(action_tile
"fs"
"(setq fs $value hs \"0\" 3s \"0\" 15s \"0\" 1s \"0\" 34s \"0\" 12s \"0\" 38s \"0\" 14s \"0\")")
(action_tile
"hs"
"(setq fs \"0\" hs $value 3s \"0\" 15s \"0\" 1s \"0\" 34s \"0\" 12s \"0\" 38s \"0\" 14s \"0\")")
(action_tile
"3s"
"(setq fs \"0\" hs \"0\" 3s $value 15s \"0\" 1s \"0\" 34s \"0\" 12s \"0\" 38s \"0\" 14s \"0\")")
(action_tile
"15s"
"(setq fs \"0\" hs \"0\" 3s \"0\" 15s $value 1s \"0\" 34s \"0\" 12s \"0\" 38s \"0\" 14s \"0\")")
(action_tile
"1s"
"(setq fs \"0\" hs \"0\" 3s \"0\" 15s \"0\" 1s $value 34s \"0\" 12s \"0\" 38s \"0\" 14s \"0\")")
(action_tile
"34s"
"(setq fs \"0\" hs \"0\" 3s \"0\" 15s \"0\" 1s \"0\" 34s $value 12s \"0\" 38s \"0\" 14s \"0\")")
(action_tile
"12s"
"(setq fs \"0\" hs \"0\" 3s \"0\" 15s \"0\" 1s \"0\" 34s \"0\" 12s $value 38s \"0\" 14s \"0\")")
(action_tile
"38s"
"(setq fs \"0\" hs \"0\" 3s \"0\" 15s \"0\" 1s \"0\" 34s \"0\" 12s \"0\" 38s $value 14s \"0\")")
(action_tile
"14s"
"(setq fs \"0\" hs \"0\" 3s \"0\" 15s \"0\" 1s \"0\" 34s \"0\" 12s \"0\" 38s \"0\" 14s $value)")
(set_tile "fs" "(setq fs $value)")
(set_tile "hs" "(setq fs $value)")
(set_tile "3s" "(setq fs $value)")
(set_tile "15s" "(setq fs $value)")
(set_tile "1s" "(setq fs $value)")
(set_tile "34s" "(setq fs $value)")
(set_tile "12s" "(setq fs $value)")
(set_tile "38s" "(setq fs $value)")
(set_tile "14s" "(setq fs $value)")
(start_dialog)
(cond
((= fs "1")
(command "-dimstyle" "restore" "DFULL")
(command "-layer" "s" "DFULL" "" "")
(command "-style" "TF1" "" "" "" "" "n" "n" ""))
((= hs "1")
(command "-dimstyle" "restore" "DHALF")
(command "-layer" "s" "DFULL" "" "")
(command "-style" "TH1" "" "" "" "" "n" "n" ""))
((= 3s "1")
(command "-dimstyle" "restore" "D3")
(command "-layer" "s" "D3" "" "")
(command "-style" "T31" "" "" "" "" "n" "n" ""))
((= 15s "1")
(command "-dimstyle" "restore" "D15")
(command "-layer" "s" "DIMENSIONS" "" "")
(command "-style" "T151" "" "" "" "" "n" "n" ""))
((= 1s "1")
(command "-dimstyle" "restore" "D1")
(command "-layer" "s" "DIMENSIONS" "" "")
(command "-style" "T11" "" "" "" "" "n" "n" ""))
((= 34s "1")
(command "-dimstyle" "restore" "D34")
(command "-layer" "s" "DIMENSIONS" "" "")
(command "-style" "T341" "" "" "" "" "n" "n" ""))
((= 12s "1")
(command "-dimstyle" "restore" "D12")
(command "-layer" "s" "DIMENSIONS" "" "")
(command "-style" "T121" "" "" "" "" "n" "n" ""))
((= 38s "1")
(command "-dimstyle" "restore" "D38")
(command "-layer" "s" "DIMENSIONS" "" "")
(command "-style" "T381" "" "" "" "" "n" "n" ""))
((= 14s "1")
(command "-dimstyle" "restore" "D14")
(command "-layer" "s" "DIMENSIONS" "" "")
(command "-style" "T141" "" "" "" "" "n" "n" ""))
) ;end cond
) ;end defun SETSCALE
Thanks for the help folks.