Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

the 3 flavors of wblock

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
dtiemeyer
583 Views, 6 Replies

the 3 flavors of wblock

wblock    brings up the dialog box that asks you to select objects, pick insertion point, name the file, etc.

-wblock   brings up the saveas dialog then proceeds with command line version of the command

-wblock with FILEDIA set to 0  uses the command line to define the file name then proceeds with command line version of the command

 

 

 

however, when I try to use LISP to force the 'w' key to be the dialog named command line version of the command, it will not play nice, it only proceeds with the command line version of the command. This is what I'm trying (it acts the same with or without the (setvar "filedia" 1)

 

(defun c:w () (setvar "filedia" 1)(command "-wblock"))

 

I'm running this at the very end of startup so that these 'keyins' take precedence over anything OOTB

 

Just to be clear, I want type W <enter/space> and get the dialog named command line version of the WBLOCK command (2nd in the list above)

My other CAD is a Cadillac and I like to Revit to the Max!
6 REPLIES 6
Message 2 of 7
SoftwareSupport
in reply to: dtiemeyer

What is your CMDDIA set to?

Message 3 of 7
dtiemeyer
in reply to: SoftwareSupport

it was set to 1, but I also tried 0, this variable seems to have no effect on the command

My other CAD is a Cadillac and I like to Revit to the Max!
Message 4 of 7
Moshe-A
in reply to: dtiemeyer

Hi,

 

Generally calling standard autocad command from (command) / (vl-cmdf) functions

(or script file) will invokes it's command line behaviour (no dialog box).

to achieve what you want? you need to call (initdia) function just before.

 

(initdia)

(command ".wblock")

 

althought the online-help does not specially mentions that WBLOCK is supported - it works!

 

(initdia) effects only the next call (and next call only) of a command that comes with dialog box.

 

Cheers,

Moshe

 

 

Message 5 of 7
SoftwareSupport
in reply to: Moshe-A

That worked for me!

Message 6 of 7
dtiemeyer
in reply to: Moshe-A

Thanks Moshe-A

 

You were right on. Except I wanted (command "-wblock)  not (command ".wblock")   but the initdia part is what got me there.  Cheers!

 

Dustin

My other CAD is a Cadillac and I like to Revit to the Max!
Message 7 of 7
Moshe-A
in reply to: dtiemeyer

over night i recalled there is another simple way

 

(command ".wblock" "~")

 

but this way you can not have the file name in a variable

 

Moshe

 

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost