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

Lights in AutoCAD 2007 - Part 1

I'm sure you have heard by now that AutoCAD 2007 has gotten a major overhaul in its 3D Modeling capabilities. These changes wouldn't make much difference if they didn't improve lighting, materials and rendering as well.  In this posting I take a look at some of the new lighting improvements at a very basic level.

AutoCAD 2007 supports 4 different types of light sources (5 if you are going to count default lighting).  The four different types of lights are Point, Spotlight, Distant and Sun light.  Point, Spotlight, and Distant lights were all available in previous releases of AutoCAD that supported rendering (all the way back to R13).  Point lights are lights that emit light in all directions, and are similar to a candle or a common household light bulb and as the light moves further away from the source it gets dimmer.  A spotlight, would be similar to a flash light as it emits in a specific direction and as the light gets further away from the source it gets dimmer.

Lights

  1. Point light
  2. Spotlight
  3. Distant light

Distant lights are lights that emit light along a specified vector, but the light does not get dimmer the further away from the source that it gets.  A distant light would be similar to the sun, the angle and direction affects how the light is emitted.  Sunlight is really a specific distant light that allows you to control the time and day of the sun, and its position through longitudinal and latitudinal values.  All lights can be selected in the model using the Lights in Model palette or in some cases light with the point and spotlights can be selected and manipulated directly in the model using grips.

Lightsin_modelpalette Grip_editing_lights_1 

That is about all the time I have for now on lights, until next time.

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

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

Double Clicking a Dimension to Open the Text Editor - AutoCAD 2007

I just recently read through AUGI 's Top Ten Wish List for AutoCAD and noticed that number 8 on the list can be achieved with AutoCAD 2007 using the Customize User Interface (CUI) editor.  The number 8 with is to be able to double click on a dimension to open the text editor.  By default double clicking on a dimension opens the Properties palette which is nice, but in some cases not exactly the designed outcome.  AutoCAD 2007 introduced the ability to edit the action that happens when you double click on an object in the drawing window through the CUI editor.  I have included the steps to do this, and if you want to do something other than open the Properties palette or start the DDEDIT command you can create a custom command or AutoLISP file to use instead.

Modifying a Double Click Action in AutoCAD 2007

  1. Start the CUI editor, click Tools >> Customize >> Interface or type in CUI at the command prompt.
     
  2. In the Customizations In pane, click the plus sign next to Double Click Actions.
     
  3. In the Command List pane at the bottom, look for the command Edit.

    Tip: Click in the Command List pane and press 'E' on the keyboard to jump to the commands that begins with that letter.  You can enter more than one of the first letters of the command if you enter them really quickly to get even closer to the command you are looking for.
     
  4. Select the Edit command in the Command List pane and while holding down the left mouse button, drag the command to the Dimensions node (item) under Double Click Actions in the Customizations In pane. Release the mouse when Dimensions is highlighted to replace the Properties command with the Edit command.

    Modify_dimension_dblclk
     
  5. Click OK to save and apply the changes.
     
  6. Open a drawing with a dimension in it or create a new drawing and add a dimension to it.
     
  7. Double-click the dimension object and the In-place Editor starts.

For more information on AUGI's Top Ten Wish List for AutoCAD visit AUGI.com.  AUGI is one of the best peer-to-peer sites out there for Autodesk products.

Sincerely,
  Lee

Mail Bag - How do I rotate the crosshairs in AutoCAD 2007?

Mailbag_header_2
Just recently I have received an e-mail about how one could rotate the crosshairs in AutoCAD 2007.  The user said he was able to do this in AutoCAD 2006 with easy, but was not able to do this easily in AutoCAD 2007. Being curious about this issue, I set out to find out what is different between the two releases. Well in AutoCAD 2007 the Snap and Grid tab of the Drafting Settings dialog box has been revamped and in the process the option to change the Snap Angle has been lost between AutoCAD 2006 and AutoCAD 2007. Since this was the common way to set the value from the user interface you must now resort to using the system variable SNAPANG to rotate the crosshairs.  Below is a procedure for changing the SNAPANG system variable.

  1. At the Command prompt, enter SNAPANG.
  2. At the prompt, Enter new value for SNAPANG <0>: type a new angle value and press ENTER.

Got an AutoCAD or AutoCAD LT question you are look to have answered, send me an e-mail at lee_ambrosius@hyperpics.com.

Sincerely,
  Lee

Say "Cheese", Cameras in AutoCAD 2007

Like many of the 3D features in AutoCAD 2007, cameras have gotten an update as well.  Cameras are now accessible directly from the drawing window via a graphical object that does not plot by default.  This allows you to make changes to the cameras location, its target and lens all via using grips.  You are also able to change a camera's properties via the Properties palette.  One other nice touch to the updates to cameras, is the new Camera Preview dialog box which lets you see what the camera sees as you are editing it with grips and the Properties palette.

Camera

Sincerely,
  Lee

Feeds


  • Between the Lines Blog

  • Will render for food... Digital Media Blog

  • HyperPics.com