how to "bclose" and save changes in one command

how to "bclose" and save changes in one command

Anonymous
Not applicable
1,677 Views
3 Replies
Message 1 of 4

how to "bclose" and save changes in one command

Anonymous
Not applicable

I'm using Civil 3D 2014 as regular AutoCAD.

 

"bclose" is the command to close the block editor. I had a custom lisp command to do this in one step, and I know it worked great in AutoCAD 2013, but it doesn't seem to work in 2014.

 

(defun c:shawn ()
(command "_.bclose" "_sav")
(princ) ;/silent exit
)

 

When I try this in 2014, it runs the bclose command properly, but it asks me if I want to save or discard changes. I hit save changes, and the console says there is no "_sav" command

 

Command: SHAWN
_.bclose Regenerating model.
Command: _sav Unknown command "SAV". Press F1 for help.

 

Any ideas what I need to change? I originally created that lisp command by looking at the command AutoCAD 2013 runs when I click close block editor and select save changes. in 2014, it just shows bclose and no arguments behind it, so I can't figure out how it determines whether or not to save.

0 Likes
Accepted solutions (1)
1,678 Views
3 Replies
Replies (3)
Message 2 of 4

hmsilva
Mentor
Mentor
Accepted solution

Untested, try

 

(defun c:shawn ()
   (initcommandversion)
   (command "_.bclose" "_sav")
   (princ)
)

 

Hope this helps,
Henrique

EESignature

0 Likes
Message 3 of 4

Anonymous
Not applicable
That worked perfectly. Thanks!

That initcommandversion function is interesting. Does putting a "-" before
a command act as a shortcut for initcommandversion?
0 Likes
Message 4 of 4

hmsilva
Mentor
Mentor

@Anonymous wrote:
That worked perfectly. Thanks!

That initcommandversion function is interesting. Does putting a "-" before
a command act as a shortcut for initcommandversion?

You're welcome, shawndarichuk!

The initcommandversion function forces the next command to run with the specified version.


Glad I could help

Henrique

EESignature

0 Likes