• Home
  • Training Books
  • Subscribe to Our Email Newsletter
  • About
    • Contributors
    • Feedback
    • Contact
    • Privacy policy
    • Cookie Policy

CADnotes

CAD Tutorials and Best Practices for professionals and students

  • Featured
  • AutoCAD
    • AutoLISP
  • Revit
    • Revit Architecture Basic
    • Revit MEP Basic Tutorial
  • Inventor
  • MicroStation
    • MicroStation Basic Tutorial
You are here: Home / AutoCAD / AutoCAD macros allows you to do these easily

AutoCAD macros allows you to do these easily

January 13, 2014 by Edwin Prakoso 5 Comments

In this Article...

  • Shortcut keys: Change UCS
  • More double click actions: change text layer
    • The alternative macro
  • Let’s see how it works
  • If you think it’s cool and want to learn more about macro
  • What macros do you want to share?

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.

makes my life easier

© 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:

^C^CUCS;OB

And to set UCS to World UCS, the macro is:

^C^CUCS;W

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.

creating_shortcut_keys

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:

^C^CTEXTEDIT;clayer;s-text;laymch;p;;;YES;DDEDIT;^C

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:

^C^C-layer;Make;text-layer;;change;p;layer;text-layer;;

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?

About Edwin Prakoso

I work as a Sr. Consultant in PT Cipta Satria Informatika. I've been using AutoCAD since R14 and Revit since Revit Building 9. I occasionally write for AUGIWorld magazine and I am also active in Autodesk discussion forum. I'm a member of Autodesk Expert Elite, an appreciation for individuals who give contributions to the Autodesk community.
Connect with me on twitter or LinkedIn.

Filed Under: AutoCAD Tagged With: autocad tips, layer, macro, ucs

0 0 votes
Article Rating
Subscribe
Login
Notify of
guest

guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

5 Comments
Inline Feedbacks
View all comments
francesco
francesco
6 years ago

Hi, how can I create a macro to obtain the same as torient? I working with AutoCAD 2016 lt.
Thank you

0
Reply
Mohammad Shamivulla
Mohammad Shamivulla
7 years ago

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

0
Reply
Edwin Prakoso
Edwin Prakoso
Author
Reply to  Mohammad Shamivulla
7 years ago

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.

1
Reply
Mohammad Shamivulla
Mohammad Shamivulla
Reply to  Edwin Prakoso
7 years ago

Thanq sir :)

0
Reply
JAY
JAY
11 years ago

How can i create a macro for autocad 2013 lt that is the same as torient in the full version

0
Reply
wpdiscuz   wpDiscuz

Featured

aseptic tank

Easy Design with Master Skeleton Concept in Inventor

Are you familiar with master skeleton design concept in Inventor? Read how to do it in our tutorial here! From sketches to complete assembly.

Recent Articles

  • Autodesk Construction Cloud Activity Log
  • Exporting AutoCAD Plant 3D Model to Navisworks
  • Autodesk Data Connector for Power BI is Now Available

Advertisement

New on CADnotes

  • Autodesk Construction Cloud Activity Log
  • Exporting AutoCAD Plant 3D Model to Navisworks
  • Autodesk Data Connector for Power BI is Now Available
  • Autodesk Forma Design Contest
  • Revit 2025: Toposolid Enhancements

Meet the Authors

avatar for
avatar for
avatar for
avatar for
avatar for
avatar for

Get Connected

CADnotes on FacebookCADnotes on InstagramCADnotes on TwitterCADnotes on YouTube

© 2009 – 2025 CADnotes · Feedback · Privacy Policy · Become an affiliate

wpDiscuz