My Photo

Search


  • Search 280+ postings

Site Awards



Syndications for this Site


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

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

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

AutoCAD 2006 and AutoCAD LT 2006 Bible Available

Autocad_2006_bibleWiley Publishing and author Ellen Finkelstein have released the latest copy of the AutoCAD Bible for AutoCAD 2006 and AutoCAD LT 2006. This is a very easy to follow book weighing in at around 1200+ pages packed full of tips and great examples. I had the honor of participating in this project as the Technical Editor for the both AutoCAD and AutoCAD LT content, and after reading it from cover to cover; there is no wondering why this is one of the top selling AutoCAD books on the market. There are not too many books out there that cover the material as well as Ellen explains it. To learn more about the author Ellen Finkelstein, who is a very nice individual, visit her web site at http://www.ellenfinkelstein.com. You can also purchase the book online at Amazon.com or at a chain store like Barnes and Nobles. I would recommend this book to anyone that uses AutoCAD 2006 or AutoCAD LT 2006.

Transparent Toolbar Button Images

I have been working recently on some white papers covering menu customization and one of the things that just recently came up (about five minutes ago from one of my good friends Steven). The question that he asked was how to create a transparent background in the Button Editor for creating images in AutoCAD 2004 and higher. To do this you can use the Light Grey color in the lower-left corner of the swatch for AutoCAD 2002 and earlier, or the True Color 192,192,192 in AutoCAD 2004 and later. Thanks for the memory jog Steven and an excellent question.

Sincerely,
  Lee

New AutoCAD and AutoCAD LT 2006 books

This year I have had the privilege to take a look at two very different books on AutoCAD 2006 and AutoCAD LT 2006.  These books have something to offer every user of AutoCAD and are both excellent resources to learning basic 2D to advanced 3D concepts. I am sure I will read plenty of other books on the new release yet this year, but these are the two that I have read so far.

AutoCAD 2006 for Dummies (available in May 2005)
The book is written by Mark Middlebrook and David Byrnes.  It is great for those that are new to AutoCAD or are casual users of the product.  It is a great follow up to the AutoCAD 2005 edition.  To learn more about the book, visit the Wiley publishing website.

AutoCAD 2006 and AutoCAD LT 2006 Bible (available in Sept. 2005)
The book is written by Ellen Finkelstein.  It is by far one of the best AutoCAD books that I have read from cover to cover, and is written for those that are both new and old users of AutoCAD.  Yes, I did say cover to cover - I have no life other than AutoCAD so what do you expect.  The book is one of the best on the market that covers just about every feature in the product and makes the features easy to understand and apply.  It is a great follow up to the AutoCAD 2005 and AutoCAD LT 2005 edition.  To learn more about the book, visit the Wiley publishing website.

If you are currently, using AutoCAD 2005 you might consider picking up those editions of the books as they provide many great tips that can help top make you more productive in your everyday drafting.

Sincerely,
  Lee

Feeds


  • Between the Lines Blog

  • Will render for food... Digital Media Blog

  • HyperPics.com