Visual LISP, AutoLISP and General Customization

Reply
Mentor
Posts: 363
Registered: ‎01-09-2004
Message 1 of 7 (279 Views)
Accepted Solution

the 3 flavors of wblock

279 Views, 6 Replies
02-08-2013 07:46 AM

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)

Striving to be a WOMBAT, Waste Of Money, Brains, & Talent...

⁞|⁞ Please use the Mark Solutions!.Accept as Solution and Give Kudos!Give Kudos functions as appropriate to further enhance the value of these forums. Thank you!
Active Member
Posts: 6
Registered: ‎01-28-2013
Message 2 of 7 (274 Views)

Re: the 3 flavors of wblock

02-08-2013 08:22 AM in reply to: dtiemeyer

What is your CMDDIA set to?

Mentor
Posts: 363
Registered: ‎01-09-2004
Message 3 of 7 (269 Views)

Re: the 3 flavors of wblock

02-08-2013 08:31 AM in reply to: SoftwareSupport

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

Striving to be a WOMBAT, Waste Of Money, Brains, & Talent...

⁞|⁞ Please use the Mark Solutions!.Accept as Solution and Give Kudos!Give Kudos functions as appropriate to further enhance the value of these forums. Thank you!
Distinguished Mentor
Moshe-A
Posts: 711
Registered: ‎09-14-2003
Message 4 of 7 (256 Views)

Re: the 3 flavors of wblock

02-08-2013 09:16 AM 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

 

 

Active Member
Posts: 6
Registered: ‎01-28-2013
Message 5 of 7 (249 Views)

Re: the 3 flavors of wblock

02-08-2013 09:35 AM in reply to: Moshe-A

That worked for me!

Mentor
Posts: 363
Registered: ‎01-09-2004
Message 6 of 7 (229 Views)

Re: the 3 flavors of wblock

02-08-2013 11:22 AM 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

Striving to be a WOMBAT, Waste Of Money, Brains, & Talent...

⁞|⁞ Please use the Mark Solutions!.Accept as Solution and Give Kudos!Give Kudos functions as appropriate to further enhance the value of these forums. Thank you!
Distinguished Mentor
Moshe-A
Posts: 711
Registered: ‎09-14-2003
Message 7 of 7 (215 Views)

Re: the 3 flavors of wblock

02-09-2013 12:52 AM 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

 

 

 

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community