CADTutor: The best free help for AutoCAD on the web

Michael BeallMichael’s Corner #105
September 2011

Settings & Information

by Michael Beall

As I reviewed the content for this month, I realized that 3 of the four articles cover running some type of inquiry on a drawing, and the other one shows you how to customize the Osnap setting for quicker access.

Curiously, that's what a significant percentage of your day probably boils down to: Queries, the result of which then enable you to respond appropriately, and settings which enable a quicker response. So here's what I have for you this month:

…Customizing the QAT for quicker Osnap changes
…Configuring Quick Select to use a Wildcard search for text
…Adding the Area property to Quick Properties when selecting a Hatch
…Using Bcount to automatically tally up all your blocks

The cooler evenings make for much more pleasant grilling these days. Hopefully these insights will give you a wee bit more time to experiment with a new recipe, or whatever you may find to do with all that extra time!

Happy Fall to one and all!

RSS FeedAs always, if you would like to be notified when Michael's Corner is posted each month, just subscribe to our mailing list and we'll be sure to let you know when this critter comes online. There's well over 2,000 of you now and it is an honor to be looked upon as a resource for your AutoCAD well-being. You can also keep in touch using the RSS feed. If you would like to contact me directly, you can do that also.

Blessings to one and all,
Michael

Add a Custom Button to the Quick Access Toolbar

How about we combine the power of personalizing a button with the power of the Quick Access Toolbar!? It's actually just the logical progression of implementing some of the tools we have seen before.

Many of my customers set their Osnap to be Node snap only. However, they may turn on additional object snaps during the course of the day. In this exercise you'll assign the variable for Node snap only to a custom button.

Note: Before beginning this exercise, set your Osnap to Node only. Now run the variable OSMODE and note that the value is 8. Turn on the Osnap for Endpoint and take a look at the OSMODE value: 9. Are you seeing a pattern here? The OSMODE variable holds a value that reflects the current settings of your Osnaps.

How to Add a Custom Button to the QAT

  1. Create a new command

    Open the CUI.

  2. Just above the Command list, click Create a New Command. You will see Command1 added to the list.

  3. Under Customizations in All Files, expand Quick Access Toolbars, then expand Quick Access Toolbars 1 to display your current QAT content.

  4. Drag and drop Command1

    Now drag your Command1 command up into the list of your QAT content.

    Note: Rather than dragging Command1 straight up across the ‘county line’ – which may cause the Quick Access Toolbar content to scroll away from you – drag it over to the middle section (I call it the ‘frontage road’), then drag it up to be parallel to the QAT content, then drag it into where you want to place it in the QAT list.

  5. When you click on your newly positioned Command1, the Properties for the command are displayed on the right side of the CUI.

  6. Properties

    Enter the text Node Snap Only for the Name, Command Name, and Tooltip Title.

  7. For the Macro, enter 'OSMODE;8

    Breaking it down…

    ' An apostrophe preceding the command will launch the variable as a nested process, without canceling the command that may be running.

    ; The semi-colon is used to press [Enter]. However, a semi-colon is not necessary after the last character entry of the string.

  8. At the bottom of the Properties, click in the field for the Small Image.

  9. Up in the collection of Button images, click the dot representing Node snap, to assign that image to your new command.

  10. Click OK to complete the customization and close the CUI.

  11. To test this, set the OSMODE variable to the year you were born (seriously), then take a look at the current selections by right-clicking on the Osnap button on the status bar.

  12. Now click your new 'Node Snap Only' button on the QAT, then check the Osnap settings again.

Button Image

Note: To learn more about the OSMODE variable, go to the Express Tools tab on the RibbonTools panelSystem Variable Editor.

Top of page

Power Tool

Quick Select with a Wildcard for Text

I was working on a customer's drawing the other day that had text that stated the area in square meters as ‘m2’, so I was wondering how I could highlight and select just the text with that string of characters. The Select Similar command, while very powerful in its own right, does not allow for a search string to be used as one of the criteria.

Drawing with text

The solution? The good ole standby, Quick Select! I covered Quick Select back in March 2003, so I think it's time to revisit this one.

How to Select Text Using a Wildcard

  1. Quick Select ButtonThe Quick Select command is the upper right tool on the Properties palette [Ctrl + 1].

  2. Quick Select dialog boxIn the scenario stated above, I set the Quick Select values as shown in the figure.

    Notice that when using the * Wildcard Match option that you will need to put the asterisk in the desired location. I found it best to put it on both sides of the text string.

    Note: This was a unique situation since the ‘squared’ character was a superscript. I first needed to double-click on the Mtext containing that text string, then highlight and copy the characters. Then I pasted them into the Value field for Quick Select.

  3. After configuring the conditions for the selection, click OK to apply the selection criteria and select the objects!

Top of page

The Odd Spot

Hatch Area in Quick Properties

Quick PropertiesThe Quick Properties feature (covered in Michael's Corner, August 2009 & September 2009), can be customized to display the area of a Hatch, which I thought was pretty cool.

How to Display the Hatch Area on Quick Properties

  1. Add a hatch to any object in your drawing.

  2. Toggle on Quick Properties on the Status bar [QP], then click on the hatch to display the Quick Properties window.

  3. Right-click in the thick frame of the window, then turn off the Auto-Collapse feature (which I find to be a bit of a paradox for something that's supposed to be ‘quick’).

  4. Customize

    Right-click on the frame again, then click Customize… to open the CUI, organized to specifically allow you to edit the Quick Properties content for the Hatch object.

  5. On the right, in the list of possible properties, scroll to the bottom and check the box for Area (under the General heading).

  6. Area

    Select any additional bits of information you would like to see in Quick Properties for the hatch, then click OK to save your changes and close the CUI.

  7. Now, click on your hatch and notice the additions to the Quick Properties window!

Top of page

The Basics

BCOUNT [Block Count]

Bcount not foundThis buried treasure has come up too many times in training recently, so now I feel compelled to refresh your memory. The quickest way to count the blocks in a drawing or within a selection area, is the command BCOUNT.

You can't find it anywhere on a menu, button, Ribbon, etc., you just have to know it's there. Kind of like knowing how to order from the Not-So-Secret menu at IN-N-OUT Burger.

How to Use Bcount

  1. Type BCOUNT, and you see the following prompt:

    Press Enter to select all or...

    Select objects:

  2. Blocks in a drawing

    Create a selection window around the area where you want to count the blocks, otherwise, for a tally of all the blocks in a drawing, press [Enter]. In this example, I placed a window around the furniture in a particular department.

  3. Hit the F2 key to flip to the AutoCAD Text Window and see the resulting list of blocks. You may have to scroll up to get to the top.

  4. Bonus points: To get the count into the drawing, highlight the desired content, then right-clickCopy.

  5. Go back to the drawing, then hit Ctrl + V and click in the drawing to paste the selected content as Mtext. Standard Mtext editing procedures now apply.

Font = Courier New

Hint: There's a good possibility the Count column won't ‘line up’ the numbers. In the Mtext editor, select all the text (Ctrl + A), then change the font to Courier New… and they line up quite nicely.

Top of page

Left Field

Photographic Memory… Literally :
Stephen Wiltshire MBE, (born 24 April 1974) is an architectural artist who has been diagnosed with autism. Wiltshire was born in London, England, to West Indian parents. He is known for his ability to draw a landscape after seeing it just once. He studied Fine Art at City & Guilds Art College.

In May 2005 Stephen produced his longest ever panoramic memory drawing of Tokyo on a 10-foot-long (3.0 m) canvas within seven days following a short helicopter ride over the city. Since then he has drawn Rome, Hong Kong, Frankfurt, Madrid, Dubai, Jerusalem, and London on giant canvasses. When Wiltshire took the helicopter ride over Rome, he drew it in such great detail that he drew the exact number of columns in the Pantheon.

Share this page:

Share at Facebook Submit a link at Reddit Share at StumbleUpon Share at del.icio.us Share at Technorati

Local Navigation

Sponsored Links

Accessibility statement

Valid XHTML 1.0!Valid CSS!Creative Commons Licence