Dear Sir,
Can add sld file for privew
- (defun c:vblk ( / block id name )
- (cond
- ( (<= (setq id (load_dialog "vblk.dcl")) 0)
- (princ "\nDCL File not found.")
- )
- ( (not (new_dialog "valveblk" id))
- (princ "\nDialog could not be loaded.")
- )
- ( t
- (foreach tile '("GATEV" "GLOBE" "BALL" "BUTTERFLY" "CHECK" "PLUG" "WAFER" "NEEDLE" "GLOBE-CV")
- (action_tile tile "(setq name $key) (done_dialog)")
- )
- (start_dialog)
- (if name
- (if
- (or
- (tblsearch "BLOCK" (setq block name))
- (setq block (findfile (strcat name ".dwg")))
- )
- (command "_.-insert" block "_S" 1.0 "_R" 0.0 pause)
- (princ (strcat "\nBlock: " name ".dwg could not be found."))
- )
- (princ "\n*Cancel*")
- )
- )
- )
- (if (< 0 id) (unload_dialog id))
- (princ))
- bt : button { width = 15; height = 2; fixed_width = true; fixed_height = true; }
- valveblk : dialog { label = "Select block to insert"; spacer;
- : boxed_column { label = "Valves";
- : row {
- : column {
- : bt { key = "GATEV"; label ="GATE" ; }
- : bt { key = "GLOBE"; label ="GLOBE"; }
- : bt { key = "BALL" ; label = "BALL" ; }
- : bt { key = "BUTTERFLY" ; label = "B/FLY"; }
- }
- : column {
- : bt { key = "CHECK"; label = "CHECK"; }
- : bt { key = "PLUG" ; label = "PLUG" ; }
- : bt { key = "WAFER"; label = "WAFER"; }
- : bt { key = "NEEDLE"; label = "NEEDLE"; }
- }
- }
- spacer;
- }
- : boxed_column { label = "Control Valves";
- : bt { key = "GLOBE-CV"; label = "GLOBE CV"; } spacer;
- }
- : bt { key = "accept"; label = "Cancel"; is_default = true; is_cancel = true; alignment = centered; }}
|