Saturday, November 21, 2009
Home   |   Search   |   About AUGI   |   My AUGI   |   Join Now

Go Back   AUGI Forums > AUGI Technical (English) > Programming > AutoLISP
 Welcome, Guest. 

Login

Join Now FAQ Members List Calendar Search Today's Posts Mark Forums Read

AutoLISP AutoLISP or Visual LISP, learn both here!

Reply
 
Thread Tools Display Modes
Old 2004-07-22, 06:51 PM   #1
LT.Seabee
Member
 
LT.Seabee's Avatar
 
Join Date: 2004-07
Posts: 17
LT.Seabee is going the right wayLT.Seabee is going the right way
Question Design Center pause

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?

Code:
(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)
)
Code:
(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!

Last edited by Glenndp : 2004-07-23 at 03:19 PM. Reason: Place routine in code tag
LT.Seabee is offline   Reply With Quote
Old 2004-07-23, 02:52 PM   #2
peter
Vice President / Director
 
peter's Avatar
 
Join Date: 2000-09
Location: Kenosha Wisconsin
Posts: 375
peter is shooting for the starspeter is shooting for the starspeter is shooting for the starspeter is shooting for the starspeter is shooting for the starspeter is shooting for the starspeter is shooting for the starspeter is shooting for the starspeter is shooting for the starspeter is shooting for the starspeter is shooting for the stars
Default RE: Design Center pause

Can you post the dcl code too?

Peter Jamtgaard
peter is offline   Reply With Quote
Old 2004-07-23, 03:30 PM   #3
LT.Seabee
Member
 
LT.Seabee's Avatar
 
Join Date: 2004-07
Posts: 17
LT.Seabee is going the right wayLT.Seabee is going the right way
Cool RE: Design Center pause

//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;
}
LT.Seabee is offline   Reply With Quote
Old 2004-07-23, 03:46 PM   #4
stig.madsen
100 Club
 
Join Date: 2000-12
Posts: 126
stig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightly
Default

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

Last edited by stig.madsen : 2004-07-23 at 03:50 PM.
stig.madsen is offline   Reply With Quote
Old 2004-07-24, 06:02 AM   #5
sinc
AUGI Addict
 
sinc's Avatar
 
Join Date: 2004-02
Location: Colorado
Posts: 1,531
sinc is shooting for the starssinc is shooting for the starssinc is shooting for the starssinc is shooting for the starssinc is shooting for the starssinc is shooting for the starssinc is shooting for the starssinc is shooting for the starssinc is shooting for the starssinc is shooting for the starssinc is shooting for the stars
Default RE: Design Center pause

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 out for more details on creating the pallettes.
__________________
-- Sinc
Civil-3D/Map 2009
http://www.ejsurveying.com
http://www.quuxsoft.com
(Sincpac-C3D)
sinc is offline   Reply With Quote
Old 2004-07-24, 06:04 AM   #6
sinc
AUGI Addict
 
sinc's Avatar
 
Join Date: 2004-02
Location: Colorado
Posts: 1,531
sinc is shooting for the starssinc is shooting for the starssinc is shooting for the starssinc is shooting for the starssinc is shooting for the starssinc is shooting for the starssinc is shooting for the starssinc is shooting for the starssinc is shooting for the starssinc is shooting for the starssinc is shooting for the stars
Default

Oh, I think the symbol manager might be a Land Desktop utility...
__________________
-- Sinc
Civil-3D/Map 2009
http://www.ejsurveying.com
http://www.quuxsoft.com
(Sincpac-C3D)
sinc is offline   Reply With Quote
Reply


Go Back   AUGI Forums > AUGI Technical (English) > Programming > AutoLISP

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Design Options - Tips sbrown Revit Architecture - Tips & Tricks 10 2009-08-26 11:48 AM
SOM to use Revit for new WTC design! Scott Davis Revit Architecture - General 27 2004-08-20 09:46 PM
Design Center blocks not scaling properly mjsregister ACA General 3 2004-06-14 10:27 PM
OK it's the 16th of December rhys Revit Architecture - General 31 2003-12-19 04:22 PM
Edited: Autodesk Almost Ready to Launch Revit 6.0!!!!!! czoog Announcements 13 2003-12-17 07:38 AM


All times are GMT +1. The time now is 12:08 PM.