LT.Seabee
2004-07-22, 04:51 PM
I'm trying to create a LISP routine that will allow us to select from the standard company blocks and put them on the correct layer and then return to the current layer. So far I can't make the routine let design center select the block and drag and drop and then continue. I've included the code, can someone give me a hint?
(defun cleanup ()
(pause) ; this doesn't seem to work
(setq last (ssget "L"))
(setq lastp (entget last))
(setq lastp
(subst (cons 8 ly)
(assoc 8 lastp)
lastp
)
)
(entmod lastp)
)
(defun c:wc (/ dcl_id lyn lye lyd)
(princ "- Water Closet -")
(terpri)
(setvar "cmdecho" 1)
(setq cl (getvar "clayer"))
(setq dcl_id (load_dialog "ned.dcl")) ;Starts New/Existing/Demo routine
(if (not (new_dialog "ned" dcl_id)) (exit))
(action_tile "new" "(setq lyn $value)")
(action_tile "exist" "(setq lye $value)")
(action_tile "demo" "(setq lyd $value)")
(action_tile "accept" "(done_dialog 1)")
(action_tile "cancel" "(done_dialog)")
(start_dialog)
(unload_dialog dcl_id)
(cond
((= lyn "1")(setq ly "P-FIXT" cly 1)(new2))
((= lye "1")(setq ly "PEFIXT" cly 15)(exist2))
((= lyd "1")(setq ly "PXFIXT" cly 9 lly "hidden2")(demo2))
)
(command "._adcnavigate" wc "") ;Design Center opens @ selected directory
(princ "\nSelect block: ") ;Ask user to select block
(while (> (getvar "cmdactive") 0) (command pause)) ;and this doesn't seem to work either
(command "layer" "s" ly "")
(setvar "clayer" cl)
(princ)
)
Any help would be greatly appreciated!
(defun cleanup ()
(pause) ; this doesn't seem to work
(setq last (ssget "L"))
(setq lastp (entget last))
(setq lastp
(subst (cons 8 ly)
(assoc 8 lastp)
lastp
)
)
(entmod lastp)
)
(defun c:wc (/ dcl_id lyn lye lyd)
(princ "- Water Closet -")
(terpri)
(setvar "cmdecho" 1)
(setq cl (getvar "clayer"))
(setq dcl_id (load_dialog "ned.dcl")) ;Starts New/Existing/Demo routine
(if (not (new_dialog "ned" dcl_id)) (exit))
(action_tile "new" "(setq lyn $value)")
(action_tile "exist" "(setq lye $value)")
(action_tile "demo" "(setq lyd $value)")
(action_tile "accept" "(done_dialog 1)")
(action_tile "cancel" "(done_dialog)")
(start_dialog)
(unload_dialog dcl_id)
(cond
((= lyn "1")(setq ly "P-FIXT" cly 1)(new2))
((= lye "1")(setq ly "PEFIXT" cly 15)(exist2))
((= lyd "1")(setq ly "PXFIXT" cly 9 lly "hidden2")(demo2))
)
(command "._adcnavigate" wc "") ;Design Center opens @ selected directory
(princ "\nSelect block: ") ;Ask user to select block
(while (> (getvar "cmdactive") 0) (command pause)) ;and this doesn't seem to work either
(command "layer" "s" ly "")
(setvar "clayer" cl)
(princ)
)
Any help would be greatly appreciated!