Print Page | Close Window

Macro

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DXF formats, Design Review, AutoCAD web, Drive, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=10989
Printed Date: 10.Jul.2026 at 17:33


Topic: Macro
Posted By: stpierre6153
Subject: Macro
Date Posted: 16.Feb.2015 at 22:34
I am new to AutoCAD LT. I have run full AutoCadd since version 1.1. Yes thats how old I am. Here is my question, I have a couple of very easy two command lisp's that i am lost with out that I cannot use in LT because you cannot use LISP files. Below are the LISP's. How do I put these into LT, macro, etc. 
;;; zooms window
(defun c:w()
(command "zoom" "w")

;;; zooms all
(defun c:za ()
(command "zoom" "a")

;;; zooms previous
(defun c:zx()
(command "zoom" "p")

If anyone can help I would greatly appreciate it. The problem with growing old and being set in your ways.

Thank you,


-------------
Stpirre6153



Replies:
Posted By: John Connor
Date Posted: 16.Feb.2015 at 23:04
Create macros.  One way to do it would be to write your own.  The other way to do it would be to use AutoCAD's action recorder feature.  Record the steps you normally would take and when done save the macro for future playback.  I've done this for a macro that will run a -purge on a drawing, then an audit followed by a zoom > extents and finally a save.

By the way, if you create your own macro you could assign it to a button and place it on a toolbar.  Click on the button and the macro is invoked.

Another option might be to assign the commands to your mouse buttons.


-------------
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>



Posted By: Kent Cooper
Date Posted: 17.Feb.2015 at 16:30
In the case of Zoom Window, you don't need to program anything for that.  The Zoom command operates in Window mode by default if you don't specify something else.
 
Macros for the other examples would be dead simple, and would contain something as basic as:
 
'ZOOM A
 
'ZOOM P
 
Note that often macros that you'll see around start with ^C^C, which is a double Cancel, to get you out of any command you might be in when you pick the menu item that contains the macro.  But in the case of something like Zoom [and certain other commands], which can be used transparently, you don't want to do that.  As written above with the apostrophe prefix, you can use them in the middle of some other command, provided the resulting Zoom doesn't trigger a REGEN.


Posted By: Robert_D
Date Posted: 17.Feb.2015 at 19:17
Yet another alternative would be to explore non-Autodesk products. i.e: Bricscad, Graeberts Ares Commander, ZWCad, and others. Lisp support (at much less than the cost of LT).


Posted By: John Connor
Date Posted: 17.Feb.2015 at 19:33
Too bad the OP already made the investment in LT 2015.  Maybe he can get a refund.


-------------
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>



Posted By: Robert_D
Date Posted: 17.Feb.2015 at 21:15
Originally posted by John Connor John Connor wrote:

...Maybe he can get a refund.
Depends on how "new" he is to LT. Only has 30 days. Don't know what the obligatory Letter of Destruction entails.
Cheers


Posted By: stpierre6153
Date Posted: 20.Feb.2015 at 14:00
Thanks for the input; however i do not want to put the macros into a button format. I would like to able to do a keyboard input.

-------------
Stpirre6153


Posted By: John Connor
Date Posted: 20.Feb.2015 at 14:39
Options.

1. Edit CUI.

2. Use the Action Recorder.

3. Use your fingers (ex. Z Enter A Enter).

4. Toolbar buttons.

5. Programmable mouse.

Pick one.

BTW...if you double click your mouse wheel AutoCAD will do a zoom > extents which is almost as good as a zoom > all.


-------------
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>



Posted By: Kent Cooper
Date Posted: 20.Feb.2015 at 17:37
Originally posted by stpierre6153 stpierre6153 wrote:

Thanks for the input; however i do not want to put the macros into a button format. I would like to able to do a keyboard input.
 
Defining/(defun)ing them as commands for keyboard input of command names is simply not an option in LT, lacking AutoLisp capability.  But as John Connor has suggested, at least in some of your examples, it's not much more work to just do them manually, e.g. to type Z [Enter/space] A [Enter/space] instead of your equivalent command name ZA [Enter/space].  And as I pointed out earlier, your W command can be just Z, since Zoom does the W option without specifying it, if you don't specify something else.  Of course the simplicity of manual usage won't be true of a lot of other things you might want to shortcut -- John has already listed the options available to you.


Posted By: stpierre6153
Date Posted: 24.Feb.2015 at 19:44
Thank you again. As you pointed out with regard to hitting Z enter invokes the zoom, window I know that........ The PITA with not being able to invoke two commands with one enter is my issue. with 30+ years the hand movement is ingrained.

Thank you anyway.


-------------
Stpirre6153



Print Page | Close Window