Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

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

the 3 flavors of wblock

363 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!

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
SoftwareSupport
Posts: 6
Registered: ‎01-28-2013
Message 2 of 7 (358 Views)

Re: the 3 flavors of wblock

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

What is your CMDDIA set to?

Mentor
dtiemeyer
Posts: 403
Registered: ‎01-09-2004
Message 3 of 7 (353 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: 829
Registered: ‎09-14-2003
Message 4 of 7 (340 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
SoftwareSupport
Posts: 6
Registered: ‎01-28-2013
Message 5 of 7 (333 Views)

Re: the 3 flavors of wblock

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

That worked for me!

Mentor
dtiemeyer
Posts: 403
Registered: ‎01-09-2004
Message 6 of 7 (313 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: 829
Registered: ‎09-14-2003
Message 7 of 7 (299 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

 

 

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.