PDA

View Full Version : Design Center pause



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!

peter
2004-07-23, 12:52 PM
Can you post the dcl code too?

Peter Jamtgaard

LT.Seabee
2004-07-23, 01:30 PM
//New - Existing - Demo Selection
ned: dialog {
label = "New - Existing - Demo Selection";
: row {
: radio_column {
: radio_button {
key = "new";
label = "New";
mnemonic = "N";
}
: radio_button {
key = "exist";
label = "Existing";
mnemonic = "E";
}
: radio_button {
key = "demo";
label = "Demolition";
mnemonic = "D";
}
}
}
ok_cancel;
}

stig.madsen
2004-07-23, 01:46 PM
Harvey, it's not possible to have AutoLISP wait for a user to drag and drop from the Design Center. As soon as the command gets the path, it will be over and done with.
However, you can store the values somewhere and have a reactor detect a drag and drop event. E.g. a command reactor could tell you when DROPGEOM has been issued, whereafter you can investigate the object and do your settings from the stored values.

Added: It's somewhat of a project, though (I can foresee alot of checking before it works) but not impossible - given a day or two of coding :)

sinc
2004-07-24, 04:02 AM
Check into the symbol manager. It lets you create a symbol, which consists of a very flexible variation of a block that you can insert with a single mouse-click. You can define a symbol as being a drawing, i.e. a block, that should be inserted. You can tell it to automatically rotate blocks as they are inserted, or scale them according to the drawing scale, or always put them on a specific layer, execute any piece of lisp code before or after inserting the block, insert symbols repeatedly until the user hits ESC, etc. Since it allows you to execute lisp code, you can even bypass specifying a block at all. If you don't specify a drawing (block) to insert, inserting that particular symbol will simply run your lisp code (which will behave exactly as it would if you ran the lisp from the command line).

You can create pallettes containing your custom symbols. Then just start up the symbol manager, click on the desired symbol and select where to insert it. Check this (http://www.avatechsolutions.com/training/elearning/media/techtips/index.asp?mid='173') out for more details on creating the pallettes.

sinc
2004-07-24, 04:04 AM
Oh, I think the symbol manager might be a Land Desktop utility...