My Photo

Search


  • Search 280+ postings

Site Awards



Syndications for this Site


Adding the Layout Name via Fields to a Title Block

From time to time I have had users asking how to place the layout name in their title block because they don't use Sheet Sets, or they want to added it to a multiline text (Mtext) object to use as part of a plot stamp.  The layout name can be obtained using the System Variable field type with the system variable name CTAB.  CTAB holds the current layout tab name, whether it is a model or paper space layout.  This very question just came up again recently by Heidi Hewett.  I shared my solution with Heidi and she has posted a blog article on this very topic called Good Question: Layout names and fields.  Thanks to Heidi for creating the posting, and sharing all here other wonderful information on sheet sets and fields through her blog.  Heidi's blog is AutoCAD Insider: Taking CAD concepts to the next level.

Sincerely,
  Lee

Mail Bag - Why do some commands support the use of additional characters in front of their names, and others do not?

Mailbag_header_2
The Mail Bag has become one of my favorite new little segments on my blog, and by the number of comments that I have been getting it looks like many others agree as well.  In today's Mail Bag, a reader has a question about why there are some commands that have an additional character in front of their names and there is the same command with out that additional character.  For example, to plot a drawing you would use the PLOT command, but there is also a -PLOT command.  Both the PLOT and -PLOT command allow you to plot a drawing, but to get to the final output from the command the process is a little bit different.  The PLOT command displays a dialog box under normal situations, while the -PLOT command displays a series of command prompts to help plot a drawing.  Below is a listing of a few characters that you might encounter when creating your own macros, or when you are trying to create a basic script to automate AutoCAD or AutoCAD LT.

- (Hyphen) - Command displays command prompts instead of a dialog box, in most cases the commands that support a version of the command are ones that display a dialog box.  A few examples are the -PLOT vs. PLOT, -LAYER vs. LAYER, and -ARRAY vs. ARRAY commands.

+ (Plus) - There are a couple different types of commands that use the plus symbol in front of commands.  The most common commands that have a plus symbol in front of their name are the ones with tabs, such as the Options dialog box or UCS dialog box.  A few examples are the +OPTIONS vs. OPTIONS, +DSETTINGS vs. DSETTINGS, and +UCSMAN vs. UCSMAN commands.  When the +OPTIONS is typed at the command line the prompt Tab index <0>: is displayed.  If you want to display the User Preferences tab you would enter a value of 5, the leftmost tab is 0.  Another version of a command that can use the plus symbol is the variation of the PUBLISH command.  If a plus is placed in front of the command you are able to browse and select an existing DSD file from a standard file navigation dialog box.

' (Apostrophe) - The apostrophe symbol is used by some commands that can be used while another command is already in progress, in this state a command is known as a transparent command.  Most commands can not be used transparently when other commands are running.  The most commonly used commands that are used transparently are ZOOM, PAN, and -VIEW.  There are many other commands that can be used transparently, as well and those are often used to control entity property settings such as COLOR, LTYPE, and SETVAR.  To use a command transparently, simply start another command that displays a command prompt such as the LINE command, and then enter 'ZOOM at the command prompt while the LINE command is still in progress.  AutoCAD indicates that you are in a transparent command with the display of >> in front of the command prompt.  Once the transparent command has ended or been cancelled you are returned to the previous command prompt of the original command, in the example it is the LINE command.

Command: l
LINE Specify first point: 'zoom

>>Specify corner of window, enter a scale factor (nX or nXP), or
[All/Center/Dynamic/Extents/Previous/Scale/Window/Object] <real time>:

>>Press ESC or ENTER to exit, or right-click to display shortcut menu.

Resuming LINE command.
Specify first point:
Specify next point or [Undo]:

For additional information on what commands can be used transparently, which ones support a hyphen or simply a list of all commands in AutoCAD use the links below.

Transparent AutoCAD Commands
Hyphened AutoCAD Commands
AutoCAD Command Reference (R12 through 2007)

Another create feature when wanting to learn about what commands and system variables in AutoCAD is the AutoComplete feature at the command prompt.  It allows you to find a command that you only remember the first few letters of.  To use AutoComplete, type in the first few letters at the command prompt and press the TAB key until you find the command you are looking for.  So if you wanted to know all of the commands that can use the + (plus) symbol, you can type the + symbol and then press Tab until you cycle through all the commands or until you found the one that you are interested in.

For some additional information on the AutoComplete feature see the links below:
Forgot a Command's Name, Now What?
What Was That AutoCAD System Variable or Command?

Got a question that you are looking for an answer to, send me an e-mail and I will be more than happy to help you out.  Use the Email Me link below the About section on this page or click here.

Sincerely,
  Lee

Mail Bag - When sharing a CUI file, why do the icons not appear correctly?

Mailbag_header_2
Time to respond to another piece of mail, <swish swish> this one comes from the middle of the bag and has a question about sharing CUI files, but mainly with sharing those cool icons that someone spent time making for their custom commands. The issue is that when associating images to a command in the Customize User Interface editor, by default the images that are assigned to a command in CUI are listed as absolute paths which doesn't work the best when sharing CUI files with custom images; especially if a change is made to the CUI file after you gave them the MNR file.

The best solution when creating a custom command is to only have the file name and extension in the Small Image and Large Image fields, instead of the absolute path to the file.  If the images don't reside in the specific spot called out in the CUI file, AutoCAD gets rather confused (meaning the Clouds with a Question Mark appears on the toolbar for the commands that have missing icons).  Below are a few rules to go by to help avoid the dreaded "Cloud of Mystery" icon in AutoCAD when sharing customization files, at least its not the sinister looking smiley any more; curse you Mr. Smiley and those sunglasses of yours.

Smiley_missing_icon

Rules to go by when assigning icons to custom commands:

  1. Assign the image using just the file name and extension, and if you want to you can also use relative paths as well.  AutoCAD simply searches all of its support paths based on the file name and/or relative path that is provided with the assigned image.

    Such as:
    Myicon.bmp
    icons\Myicon.bmp

    The Icons folder that is mentioned above is an Icons folder that is located under a support path that is already part of AutoCAD's Support File Search Path.
  2. Place the images in a safe place other than your My Documents folder. Usually on a networked location if you are sharing the CUI file with multiple individuals or if you work by yourself you can place the images in a specific folder so you can migrate them easily to a future release, such as Icons under C:\Documents and Settings\<user name>\Application Data\Autodesk\AutoCAD 2007\R17.0\enu\Support. If you place your images in a folder other than Icons, make sure to add the path to AutoCAD's Support File Search Path under the Files tab of the Options dialog box.
  3. Alternatively, you can create a resource DLL that contains the images that are specific to your CUI file. If you create a resource DLL for your menu, it should be placed in the same directory as your menu and have the same name. So if your CUI file is named MyCUI.cui, the resource DLL should be named MyCUI.dll. There are many ways to create the resource DLL, but commonly they are created with Visual Basic or Visual C++.

These changes to the way you assign and manage your images for custom commands will help when sharing customization files and make migrating much easier for future releases.

Sincerely,
  Lee

Out with Some More Old and In with Some More New

As I continue to purge out a lot of my older formatted web pages and roll in the new look and design, I keep an eye on ways to better streamline the content that I develop and deliver through my website.  One of the newest sections of the site to get a face lift is the AutoLISP functions listing, while it is not fully converted over yet, the information under the section is much easier to view and access now.

The information on the pages will be morphing in the future to include references to sample code that I have on my site for download.  By linking the two resources together, it will help users that are new to AutoLISP and want to learn a little more about the functions that are in a routine that I offer, and for those of you that are looking to enhance your existing programs with some new code. Let me know if you have any ideas that would help to improve the site and the content further.

Click here to access the new AutoLISP Functions area on HyperPics.com.

Sincerely,
  Lee

VBA Downloads for AutoCAD

I have uploaded a couple of additional sample VBA projects to my website that can be downloaded.  Below is an overview of the 4 samples that are currently available.

CustomDblClickEdit - This example is used to demonstrate how you can replace the standard functionality of the Double Click Editing inside of AutoCAD of your own handler. This allows for changing the default editors and the way objects are handled. Some what out dated with AutoCAD 2007, but if you are using a previous release and what to customize the actions that are performed when double clicking objects, you will want to check this one out.  Last updated for 2004, but will still work with 2005 and 2006 though.

SheetCount - This example is used to demonstrate how to create a custom sheet set property that holds the total number of sheets for all the sheets in the sheet set file. Project was originally developed with AutoCAD 2005 and later tested under AutoCAD 2006. A new version is now available for download that will work with AutoCAD 2007.

SummaryInfo - This example shows how to list, create and modify both standard and custom drawing properties for the current drawing. This is a great example to build on if you want to automate the population of custom properties that you want to use with fields in text objects.

The VBA sample code download page is available by clicking here. Check back once in a while as I will be uploading new samples as I have time to clean some of them up.  You never know what might show up on the site.  Stuck on trying to figure something out in VBA, just let me know and I will see what I can do about putting together a sample project file for you.  Looking for some AutoLISP sample code, well click the jump to access our AutoLISP downloads page.

Sincerely,
  Lee

Using Icon Switches with AutoCAD 2007

Icon switches (or command line switches) are often a forget method of customizing AutoCAD to gain some additional productivity benefits.  Did you know you could use an icon switch to specify the default profile or drawing template that AutoCAD starts up with when you double-click on the desktop icon.  Maybe you have been trying to figure out a way to specify a specific workspace to be displayed when you start up AutoCAD, wonder no more.  Icon switches allow you to do those things and much more with AutoCAD 2007.  AutoCAD has supported icon switches for along time now, since about R14.  To learn more about the icon switches in AutoCAD 2007 and previous release, click the link to access the AutoCAD Icon Switches PDF file from HyperPics.com.  The PDF file includes information about all the different icon switches available, and even a short tutorial on how to modify a desktop icon to use the icon switches.

Mail Bag - How can I align text when creating a new text object in AutoCAD?

Mailbag_header_2
I recently got an e-mail about how you could align a new text object vertically based on existing text object that already exists in the drawing.  Most people and I am among them, often create a text object and then align it with an existing text object, but you can cut down on having to start the Move command and picking a base point and then a second point by using point filters or object snap tracking based on your preference to align text objects.

Note: How the text objects align is based on the current text alignment of the new text object and the existing text object.

Using Object Snap Tracking to Align Text Vertically

  1. Before you start creating a new text object, turn on the Insertion object snap and enable object snap tracking by clicking the OTRACK button on the status bar.
  2. Start the DTEXT or MTEXT command.
  3. At the Specify start point of text or Specify first corner prompt, hover over the text object's Insertion point.  You should see a vector is displayed vertically from the Insertion point which allows you to specify a point along that vector path.
    Aligntextvertically
  4. Enter a distant to specify a new point, or simply click along the vector.
  5. Once the start point or first corner has been specified you can finish the command like you normally would.

Using Point Filters to Align Text Vertically

  1. Start the DTEXT or MTEXT command.
  2. At the Specify start point of text or Specify first corner prompts, enter .X and press Enter.  You could also hold down the SHIFT key, right-click and select Point Filters >> .X.
  3. At the prompt .X of, enter INS and press Enter.  You could also hold down the SHIFT key, right-click and select Insert.
  4. Select the Insertion point of the text object you want to vertically align with, and then pick a second point to determine the Y coordinate value.
  5. Once the start point or first corner has been specified you can finish the command like you normally would.

Alternatively, you could also use AutoLISP to simplify the process even further.  Belolw is a very basic example that simply starts the DTEXT command based on the insertion point of a selected text object.  The example lacks some error checking and is designed just to show a conceptual way of how to align text vertically or horizontally with other text object that already exists in a drawing.

(defun c:AlignVertically ( / ent ent_data pt-align)
  (if (setq ent (entsel "\nSelect a text object to align vertically with: "))
    (progn
      (setq ent_data (entget (car ent)))
      (if (setq pt-align (getpoint (cdr (assoc 10 ent_data)) "\nSpecify start point: "))
        (command ".dtext" pt-align)
        (prompt "\nNo Point selected.")
      )
    )
    (prompt "\nNo object selected.")
  )
(princ)
)

Sincerely,
  Lee

AutoCAD Tip: Clipping Blocks

The command XCLIP is known as "Xref clip", but many might not know that XCLIP can be used to clip block what objects are displayed. To clip a block, start the XCLIP command by entering it at the command line or selecting Xref from the Modify menu > Clip. Select the block and follow the prompts to create a new boundary that should be used to clip the block.

This is how the SUPERHATCH command that is part of Express Tools works. It determines how the objects in a block can be placed within a given boundary and then clips the objects that don't fit nicely in that boundary. SUPERHATCH is a great command for creating custom hatch patterns based on images, blocks, wipeout objects, and xrefs. SUPERHATCH can be found under the Express menu > Draw > Super Hatch.

Sincerely,
  Lee

Autodesk Offers AU Discount to All

Autodesk is offering a discount of 20% off all of is Autodesk courseware purchased through the eStore from now until December 15, 2005.  This was an offer that was introduced at this years AU and has been extended to include everyone.  There are many great titles that are being offered through Autodesk courseware and I can personally say that many of them are not just something that you will toss in the corner of your workstation and forget about.

Check them out on the Autodesk website.

Use the Promo Code "AU2005" when ordering.

The courses cover a wide variety of products that Autodesk offers including...
AutoCAD 2006
AutoCAD LT 2006
Autodesk Inventor 10
Autodesk Vault R4
Autodesk Revit Building 8
Autodesk Revit Structure 2
and others...

Sincerely,
  Lee

October Issue of HotNews

Trick or Treat maybe not yet, but the October issue of AUGI HotNews brings a treat with another round of excellent articles.

Migration Madness!
Avoid the potholes on moving day! Here are tips for smoothing the move from one version to another.

Customization Corner: Creating Toolbars with the CUI
How to create toolbars through AutoCAD 2006 software's CUI Editor.

TIPniques: The Power of Page Setups
Guest columnist and AUGI Board Member Mike Perry tells how to make plotting from AutoCAD an easy and stress-free process.

The above listings are some of the highlights of the newsletter, but there are many other great articles in this issue.  To access all the articles of the issue head to the AUGI website and click the Publications section, then AUGI HotNews.

If you are not receiving AUGI HotNews or are not a member of AUGI go to the AUGI website and sign up. It is free to receive the newsletters and becoming a member is free as well.

Click here to access the AUGI website

Click here if you are already an AUGI member, but don't receive HotNews in your inbox

Sincerely,
  Lee

Feeds


  • Between the Lines Blog

  • Will render for food... Digital Media Blog

  • HyperPics.com