Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

CUI Close command Macro

Thomasbatson
Collaborator

CUI Close command Macro

Thomasbatson
Collaborator
Collaborator

Hello,

 

I am using Autocad Electrical 2018.  My issue is that I am trying to test a command macro that isn't working.  I have previously done this with custom buttons so am not sure if what I am doing wrong with this one.  I have a simple lisp saved that is autoloaded in ACADDOC.  I changed the Macro for Close to be ^C^C_.ZeSC

I can type in ZeSC and it works, but when I type CLOSE in the command line it does not work.

 

What I am trying to do is have the system Zoom Extents Save then Close.  We are not liking the fact that many in the office are saving and closing without Zoom Extents so our previous isn't showing us the entire drawing. 

 

I hope that makes sense.  Can anyone help explain?  Maybe the close command can't be customized?  Thank you.

 

0 Me gusta
Responder
Soluciones aceptadas (2)
1.327 Vistas
4 Respuestas
Respuestas (4)

ВeekeeCZ
Consultant
Consultant
Solución aceptada

It's more complicated. You can use the name CLOSE for you routine, but you need to UNDEFINE the autocad's original command first. Then you can use your routine to define contents for the CLOSE command name.

Your lisp routine should look like this:

 

{*.lsp beginnig}

 

(command "UNDEFINE" "CLOSE")

 

(defun c:CLOSE ()

(command "_.zoom" "ex") 

(command-s "_.SAVE"

(command "_.CLOSE").....  ; note the DOT!!!!

 

BTW Your custom command marco definition: ^C^C_.ZeSC    - Added . (dot) has no sence in here. Also underscore is useless here.

0 Me gusta

Thomasbatson
Collaborator
Collaborator

That works perfect and the solution to that.  Thank you.  I know it is the answer to the questions and will mark it as solved, however do you know much about the closeall?  I am searching now for that solution and it seems much more complicated.  Thank you for the advice.

0 Me gusta

ВeekeeCZ
Consultant
Consultant
Solución aceptada

Well, it looks like it could work the same way, but after a quick test, I experienced some issues (acad 2016). 

I would probably keep my hands off since this potentially can be a risky mass job. Especially in hands of less-experienced users...

But you can try luck in the customization forum... 

0 Me gusta

Thomasbatson
Collaborator
Collaborator

It looked the same to me, seemed a bit bigger than the close.  

Thank you for checking and the help.

0 Me gusta