Nate Holt's Blog

August 12, 2015

Active DWG not in Active Project – how to add alert to selected commands

Filed under: Electrical — nateholt @ 12:19 am

I’ve done it many times. Sit there scratching my head… “Why is AcadE giving me these goofy, unexpected results?”

Eventually realize that the active drawing I’m working on is not in my current active project.

Many commands give you a clue that your drawing is not in the active project… it might be the opening dialog’s “Drawing” button unexpectedly fuzzed out but the “Project” button enabled. You might even get a nice warning message. Here is what the Terminal Strip Editor tells you…

n8_016

But some commands don’t give you such an in-your-face warning. Here’s a potential solution…

Avoiding this Embarrassment

There is an ugly way to automatically get an alert if you launch your command on a drawing that is not in the active project. It involves adding a string of text to the command’s “Macro” string in the ribbon menu.

Example: Let’s say more than once you’ve tried to run the Wire Annotation command on a drawing that wasn’t in the active project. This has triggered momentary frustration.

Let’s add a check/alert to the Wire Annotation command’s entry in the ribbon menu.

n8_010

Step 1: Launch CUI command. Select “Electrical Commands” as shown below to narrow the search.

n8_011

Step 2: Scroll down through the list and find the Wire Annotation command’s entry. Pick it.

In the “Properties” on the right side of the dialog, look for the “Macro” entry. This is what you want to carefully edit.

Note that the internal AcadE command name for the Wire Annotation command is AEWIREANNOTATION. It is embedded in the macro string shown below.

n8_012

Step 3. Now CAREFULLY change the macro string value to one of the two new strings below. The one you pick depends upon what you want to happen if your drawing is not in the active project when you launch the Wire Annotation command. Option 1: If you want the alert to pop up and then the command exits without running, edit the Macro string as shown below, carefully preserving the internal AcadE’s command name but substituting a “c:” for the “_” character.

n8_014

Note that the command name now has a “c:” prefix (this is NOT a drive letter!) and is in parenthesis.

Option 2: If you want the Alert to pop up and then allow the command to run after you acknowledge the alert, then carefully enter the string as shown below.

n8_015

Step 3: Save/Exit the CUI command. Test!

Here’s what you’ll now see if you pick on “Wire Annotation” command icon in the ribbon menu with a non-project drawing active on your screen.

n8_017

Advertisements

3 Comments »

  1. So glad that Nate is available! This comment has nothing to do with the Active drawing in the project, but I have other questions regarding the PLC IO utility. How can I ask? I was not really interested in creating my own blog to log in. Let me know what I need to do to ask about getting fixed, customer-look PLC’s to come in, vs the Parametric ones. Gail

    Comment by Gail — September 1, 2015 @ 3:58 pm

    • Hi Gail,

      AutoCAD Electrical has a sample set of “fixed” PLC symbols mixed in with the default schematic symbol set. They show up on the default schematic icon menu under PLC I/O –> PLC I/O Fixed Units. Insert and explode one of these or open the source DWG file for it. You should be able to figure out what attributes go where in order to make an equivalent customer-specific symbol work with AutoCAD Electrical.

      If you cannot figure it out, I can take a look if you send me a sample.

      thanks,
      Nate.
      N8 Consultants LLC
      Toledo, OH
      n8holt@gmail.com

      Comment by nateholt — September 1, 2015 @ 5:02 pm

      • Thanks Nate. I will try that right now.

        Comment by Gail — September 1, 2015 @ 6:13 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: