Another cool shortcuts tips by Hai Le (@ThatCADguy). These are two more examples how creating shortcuts with simple macros can increase your productivity. And make your life easier.
Check the video at the end of this post to see how easy you can copy and paste text aligned to different objects. And to move text to other layer, just a simple double click.
© blanche – Fotolia.com
But let’s see the macro first.
Before you continue, if you are not familiar with CUI, you may want to read this first: 5 articles to learn AutoCAD CUI. We will not cover in details about CUI here.
Shortcut keys: Change UCS
Changing UCS is a quick way to create aligned geometry relative to other object. In this tip, Hai Le use only keyboard shortcut to copy text and paste the copy aligned to a line.
First, you need to create 2 new commands. I name them UCSobject and UCSworld.
UCSobject is for rotating UCS to object. UCSworld is to set UCS back to world UCS.
Just like we did in dimension spacing macro, open CUI editor and create those two new commands.
To rotate UCS to object the macro is:
And to set UCS to World UCS, the macro is:
Very simple macros, right?
Now let’s assign the command to shortcut key.
1. Find your custom command. You can find it in command list (1). First we will assign UCSobject command.
2. Expand the keyboard shortcut category, then drag your custom command to shortcut keys. You will see your command below shortcut keys category (2).
3. In shortcut list (3) find your command. Click in keys column to edit it. Press desired keys combination. In this example I use ctrl+shift+A. AutoCAD CUI will fill the field automatically.
4. Repeat the procedure for UCSworld command.
You can see how this custom command in action in video at the bottom of this post.
More double click actions: change text layer
We often place texts on wrong layer. This macro will move text to text layer when you double click text.
The cool thing about Hai Le’s macro is you are still allowed to edit text when you double click it. As you know, the default action when you double click a text is to edit text.
The limitation of the original macro is you need to have s-text layer (or whatever layer name you put in the macro).
This is Hai Le’s macro:
The alternative macro
As alternative, I created a similar macro. I added command to create layer. So it will create layer if you don’t have it in your drawing. But if you already have it, it will not change the layer properties.
Then I make it only to change layer, so it’s quicker.
The downside is, it completely replace default double click action. You can’t edit text by double-clicking it anymore.
The alternative macro is:
Let’s see how it works
You can see how above macros work in video below. If you can’t see embedded video, see it on our YouTube channel here.
If you think it’s cool and want to learn more about macro
Paul Munford covered about it here: How to automate AutoCAD with command macros.
What macros do you want to share?
You have seen many cool things macro can do. It can be short enough and easy. But can gives great benefit to us. You may have your own macro to finish the job quickly. Or to avoid tedious jobs.
Do you ever created a macro to help you to finish your job? Will you share you experience here?
Hi, how can I create a macro to obtain the same as torient? I working with AutoCAD 2016 lt.
can any one help me regarding 50mb cad file how can I reduce file size as minimum of 1mb and send file to another person
Unless the drawing is bloated because of a bug, it’s not possible. You need to upload it to OneDrive or Dropbox then share the download link.
Thanq sir :)
How can i create a macro for autocad 2013 lt that is the same as torient in the full version