Categories

AutoCAD 2015 and AutoCAD LT 2015 Bible

The most comprehensive AutoCAD book around!

Defining alternate dimension units in AutoCAD

The dimension measurements in your drawing use a specific unit, whether millimeters, inches, or something else. But it’s common to need to show a second unit — perhaps a metric measurement if you’re using inches, or vice versa.

You define an alternate measurement on the Alternate Units tab of the Dimension Style dialog box. For more information about using this dialog box, see my tutorial, “Create an architectural dimension style.”

AutoCAD Dimension Styles Manager Alternate Units tab

Here are the steps to specify an alternate unit:

  1. Choose the unit you want from the Unit Format drop-down list.
  2. Choose the precision (decimal points or fraction denominator, usually)
  3. Notice the default 25.4 in the Multiplier for All Units text box. That’s because I have a United States version of AutoCAD and there are 25.4 millimeters in an inch. Of course, if that’s not what you want, change the multiplier value.
  4. There are text boxes to add a prefix or suffix. These are useful if the unit won’t be obvious. For example, if you main units are inches, you might want to add mm after your alternate units of milliemeters.
  5. The Zero Suppression section of the dialog box allows you to keep certain standards, such as not including 0 inches before (leading) or after (trailing) a measurement.
  6. Finally, on the right, specify if you want the alternate to appear after or below the primary measurement.

The settings you specify become part of the dimension style you are configuring.

Do you use this feature? What settings do you use?

Open AutoCAD with a specific template

autocad-tips-start-templateYou can launch AutoCAD with a specific template of your choice. You do this with a command line switch.

When you double-click the icon on your desktop or start AutoCAD from the Start menu, you are executing a statement. You can customize this statement by adding parameters, also called switches.

To learn the statement of your desktop icon, right-click it and choose Properties. On the Shortcut tab, look in the Target text box. This is also where you add a switch. For example, the statement might look like this:

“C:\Program Files\Autodesk\AutoCAD 2012\acad.exe”

To add a switch insert a space after the end of the statement and add a forward slash (/), then the switch you want. (AutoCAD has a number of switches, not just for templates.) In most cases you also add a descriptor.

For a template named mytemplate, you would add /t mytemplate. The statement for the Tutorial-iArch template would then look like this:

“C:\Program Files\Autodesk\AutoCAD 2012\acad.exe” /t Tutorial-iArch

Note: You need to add quotation marks around any path or name (such as the template name) that contains spaces.

I recommend duplicating the existing shortcut. When you use this method, you can create different shortcuts for different templates. To change the command line switch, follow these steps:

  1. Right-click the shortcut and choose Copy.
  2. Right-click the desktop and choose Paste. You’ll either get a new shortcut with “Copy” appended to the name or a dialog box that gives you the option to keep both the original and the copy with a number appended to the name. You can change the name of the shortcut to reflect the name of the template it will open.
  3. Right-click the shortcut copy and choose Properties.
  4. On the Shortcut tab, in the Target text box (not the Start In box), move the cursor to the end of the existing statement.
  5. Press the spacebar to add a space, then type /t and another space. Finally add the name of the template. Be sure to add quotation marks around the template name if it contains spaces.
  6. Click OK.

Try out your new shortcut by double-clicking it!

Did you find this helpful? Do you use switches? How?

Close AutoCAD quickly and safely — and get home earlier!

Just in time for the holidays, when you may want to rush out the door, here is a guest blog post from . Your family will thank you!

AutoCAD tips: Close AutoCAD quickly and safelyWe’ve all done it. You are beavering away at the office, totally engrossed in the Music on your iPod in your work, when you realize that it was time to go home minutes ago!

I want to make sure that you know about 3 really handy commands that will help you to close down a lot of open files very quickly (and safely).

Save everything

The first command is an Express tool called SAVEALL. Simply type saveall at the command line, and all your open drawings will be saved, but remain open.

Close everything

The second command is a standard AutoCAD command called CLOSEALL. Once again, simply type closeall at the command line, and all your drawings will be closed Lickety Split.

Or do both

The final command is another Express tool called QQUIT. This tool will attempt to save and close all your drawings, and then close AutoCAD down completely.

Note: If a drawing has not been saved yet, all of these commands will prompt for a file name. If you have a blank drawing file open that you don’t need to save – just hit ‘Cancel’, AutoCAD will still process the rest of the files.

Go Home

Don’t stop to thank me – have a great evening!

  is the writer of The CAD Setter Out, supplying tips, tricks and tutorials for Drafters using AutoCAD and Autodesk Inventor to create drawings for the construction industry. In his spare time Paul enjoys Drawing and Woodworking. He thinks that modelling his Joinery designs in 3D is the most fun anyone can have, by themselves…

Get rid of the default grid in AutoCAD

Starting with AutoCAD 2011, Autodesk has made the grid on by default. Do you turn it off every time you start AutoCAD?

If you don’t know how to turn it off permanently, here are the steps:

  1. Open the template you usually use. If you use the default, acad.dwt, open that. The location will depend on your release and version of Windows. You might have to search for it in Windows Explorer, because the folder path is very long! When you find it, you can double-click it to open it. If you’re navigating from within AutoCAD, be sure to choose Drawing Template (*.dwt) from the Files of Type drop-down in the Select File dialog box.

  1. Click the Grid Display button on the status bar or press F7.
  2. Save the template.

Now, when you open AutoCAD, the grid is gone!

 

Make hatching in AutoCAD easy

Hatching can sometimes be frustrating, so I’ve collected a few hatching tips together, including links to other tips. Think of the collection as your personal hatching helper.

In case you don’t know, a hatch is a pattern of lines and dots that fills an enclosed area.

AutoCAD tips-easy hatching

Create user-defined hatch patterns

When you choose a hatch pattern and apply it, it doesn’t always look the way you want it to. You can try to find a better hatch pattern, but an easy way to deal with this problem is to create a user-defined hatch pattern. A user-defined hatch pattern just lets you specify the angle of the pattern and its scale. Changing the scale is an especially easy way to correct a hatch pattern whose spacing is too close or too wide.

Increasing the scale makes the spacing wider; decreasing the scale makes the spacing closer (narrower). A value of 1 is the default, so to make the lines closer together, use a value that is between 0 and 1.

AutoCAD tips-easy hatching

Start the HATCH command

Before you start hatching, you might want to create a separate layer for the hatch and make it current. When you start the HATCH command (Home tab> Draw panel> Hatch), the Hatch Creation tab appears. Choose the pattern you want from the Pattern panel.

At the Pick internal point or [Select objects/seTtings]: prompt, click inside the closed area or use the Select objects option. An easy way to switch between picking internal points and selecting objects is to right click and choose the option that isn’t current from the shortcut menu. In this example, you would choose Select Objects.

AutoCAD tips-easy hatching

For more information, see the older (but updated) tip, “Easy hatching.”

Define the enclosed area properly

Sometimes, AutoCAD won’t hatch the right area. Here are some hints for defining the enclosed area:

Franck Wallez advises drawing with polylines, instead of with lines. One reason is that they make specifying an enclosed area easier. If your enclosed area is complex, use the BOUNDARY or REGION commands to create a closed area.

If you’re enclosed area has gaps, AutoCAD has a solution. See my tip, “Dealing with gaps.”

Customize your hatches

A user-defined hatch may not give you enough flexibility. In that case, you can build your own hatch patterns. See “Creating custom hatch patterns” for the details.

Top Customization Tips Every AutoCAD? User Should KnowTop Customization Tips Every AutoCAD User Should Know
AutoCAD is meant to be customized, but customization is one of the most complex features of AutoCAD. Gain the knowledge you need to be a master at customizing AutoCAD!

A minor customization is to specify the hatch origin. For example, if you’re filling in a wall with a brick hatch, you may want the brick pattern to start at the lower-left corner.  See the tip, “Control hatch origin.”

Another minor customization is to control islands, which are embedded shapes. See the tip, “Manage embedded shapes (islands) when hatching in AutoCAD” for more information.

What about paper space?

When you display your hatches in paper space, you may be in for a rude surprise.Your hatches in scaled viewports no longer have the right spacing! The solution is to make your hatches annotative. To do so, click the Annotative button in the  Hatch Creation tab’s Options panel.

For a tutorial on annotative objects, see “Tutorial: Automate annotation scaling with annotative objects.”

Use this secret for easy selection of hatched objects

It can be difficult to select hatched objects, because there are so many hatch lines nearby. Franck Wallez recommends the HATCHTOBACK command, which  moves all your hatching under everything else. Then, clicking on the hatched object is more likely to select the object you want and not the hatch.

Do you have any hatch tips? Please leave a comment and share them!

Done in AutoCAD 2012

Fillets–another approach using AutoLISP

Tommy Holder submitted a different approach to creating fillets–one that includes drawing the lines. For the earlier routine, see “Reduce mouse clicks and increase productivity with AutoLISP.”

Tommy’s approach is unique, I think. Instead of drawing the lines first, the AutoLISP routine prompts you for points, which are the endpoints of the lines. Here are the steps:

  1. Download fl.lsp. FL.lsp (click to download)
  2. Unzip the file.
  3. Use the APPLOAD command to load fl.lsp in a location that is in AutoCAD’s support file search path.
  4. On the command line, type fl and press Enter.
  5. At the Enter points : prompt, specify the first line’s start point.
  6. The prompt repeats, so specify the first line’s end point (which is also the second line’s start point)
  7. Next, specify the second line’s endpoint and press Enter.
  8. At the Enter BEND RADIUS <1.0000>: prompt, enter the fillet radius and press Enter.

Watch the video!

Tommy Holder has 35 years experience with Ingalls Shipbuilding on the Mississippi Gulf Coast where the company has built numerous ships for the Navy. He has been a CAD designer and developer, having written many lines of code, developed many menus, and trained many users. He has been a project lead and supervisor but found that his true calling was not in management but CAD development and helping users.

Tutorial: Create cool curves with splines in AutoCAD

Splines are mathematically-defined curves. They are an important basis for 3D modeling, but they are useful in 2D as well.

Note: Splines were significantly updated in AutoCAD 2011.

There are 2 methods for creating splines:

  • Fit Points: You specify fit points, which are on the spline (by default).
  • Control Points: You specify the control points, which usually are not on the spline itself. Useful as a basis for 3D NURBS surfaces.

I’ll give you the prompts for the Fit Points method.

Start the SPLINE command. You see the method listed on the command line, as shown here. If the method if not set to Fit, use the Method option to change it.

Like this:

Current settings: Method=Fit   Knots=Chord

or like this:

Current settings: Method=Fit   Knots=Chord
Specify first point or [Method/Knots/Object]: _M
Enter spline creation method [Fit/CV] <Fit>: _FIT
Current settings: Method=Fit   Knots=Chord

  1. At the Specify first point or [Method/Knots/Object]: prompt, specify the first point for the spline.
  2. At the Enter next point or [start Tangency/toLerance]: prompt, specify the next point. You can use the start Tangency option to specify the direction of the start of the spline. You do this by picking a point off the start point of the spline.
  3. At the Enter next point or [end Tangency/toLerance/Undo]: prompt, specify the next point or use the Close option to create a closed spline. At the 3rd and subsequent prompts, you can similarly use the end Tangency option to specify the direction of the end of the spline. The toLerance option lets you give the spline latitude, in units, from being exactly on the fit points that you specify. The default value, 0, puts the spline exactly on the fit points.
  4. Continue to specify points until your spline is done.
  5. Press Enter to end the SPLINE command.

AutoCAD tips: Draw cool curves with splines

Done in AutoCAD 2012

Repeat an AutoCAD command automatically

You probably know that after you execute an AutoCAD command, you can press Enter to repeat it.

But it might be quicker to set a command to repeat automatically, if you know in advance that you’ll use it a number of times in a row.

Some commands repeat automatically. In a sense, the LINE command does this, prompting you automatically for a new segment. and the COPY command prompts you to create additional copies. For more information, see my tip, “Changing the Multiple options of AutoCAD commands (or sometimes you feel like a multiple option, sometimes you don’t).”

Brian Glover wrote a tip about another way to repeat commands–typing multiple (and a space) before typing a drawing command.

Did you know that you can force a command to repeat itself after you finish using it? Sure there are some commands already that have multiple functions. The LINE command is a good example. Start the command, pick your first point, the next point and the next until you are done entering points and press the escape key to end the command. To draw more lines, you have to start the command again.

Unless you entered the MULTIPLE command in before you start the LINE command. Now you draw your first line, but when you press the Escape key, the LINE command starts again and you are prompted for the first point of the line. When you are completely finished drawing lines, press the Escape key a second time to end the MULTIPLE command.

This command works with all drawing commands (Arcs, Circles, Ellipses, Lines, Rectangle, etc.), Text commands, Match Properties, and even the COPY command. Please note, that it does work with the Dimension commands, but unless you are entering multiple, separate dimensions, it is better to use the DIMENSION CONTINUE command.

Remember, after using MULTIPLE before a command, when you want to stop repeating, press the Escape key. So, go ahead and make lots of arcs or rectangles. You’ll be able to do it a little faster now.

How to lock AutoCAD’s user interface

This is a guest blog post from .

It’s happened to all of us. A car outside backfires, a door slams or a cheeky college sneaks up behind you and gives you a tickle; before you know it your AutoCAD user interface is a mess!

If you’ve invested a lot of time setting up AutoCAD’s UI the way you like it, I seriously recommend that you save your user interface as a custom workspace.

However, I have another quick tip to share with you that can prevent your Ribbon tabs, Toolbars or Tool palettes accidentally being nudged around the screen.

Locking the User Interface

The secret is the little padlock icon down in your system tool tray. Clicking on this little button will lock down AutoCAD’s user interface, so that you can’t accidently move anything.

Tip: If you can’t see the control, click on the arrow at the far end of the system tool tray and select Display Locking.

autocad_tips_lock-autocad-user-interface-2

Locking separate elements of the User Interface

Clicking on the Lock UI button gives you a few choices about which UI elements you want to lock.

  • Lock all controls
  • Lock only floating Toolbars or Ribbon panels
  • Lock only docked Toolbars or Ribbon panels
  • Lock only floating windows*
  • Lock only docked windows*

*In this case ‘Windows’ refers to controls such as the Ribbon, the Design Center, and the Properties palette.

autocad_tips_lock-autocad-user-interface

You can also type lockui at the command line to access the User Interface locking settings. The LOCKUI setting is stored as a bitcode using the sum of the following values:

  • 0    Toolbars and windows not locked
  • 1    Docked toolbars locked
  • 2    Docked or anchored windows locked
  • 4    Floating toolbars locked
  • 8    Floating windows locked

But what if I WANT to move a control?

Here is one more quick tip for you. If you have your AutoCAD User Interface locked down, and you just want to nudge one control out of the way – simply hold down the CTRL key while you drag the Tool bar, Tool palette or Ribbon tab to temporarily allow moving and re-sizing of the control.

I hope that you’ve enjoyed this quick tip, now – LOOK BEHIND YOU! (Tickle, tickle)

  is the writer of The CAD Setter Out, supplying tips, tricks and tutorials for Drafters using AutoCAD and Autodesk Inventor to create drawings for the construction industry. In his spare time Paul enjoys Drawing and Woodworking. He thinks that modelling his Joinery designs in 3D is the most fun anyone can have, by themselves…

Reduce mouse-clicks and increase productivity using AutoLISP

This is a guest post by Sanjay Kulkarni, an AutoCAD programmer. You can read more about him at the end of this post.

The number of mouse-clicks required to perform a task is generally a good indicator of productivity. The fewer the number of clicks, the less time required–hence more productivity.

In this post we will see an example of reducing the number of mouse-clicks, and thus improving productivity, using AutoLISP. We will use the example of the FILLET command.

Thanks to one of the blog readers Bruce Newman, who sent a problem to me. It was the source for this post.

The most simple situation where you create a fillet is when two perpendicular lines meet. Inside the FILLET command, you select the two lines (requiring 2 clicks) and AutoCAD creates the fillet.

Reducing clicks and increasing productivity in AutoCAD with AutoLISP

 

The equivalent AutoLISP code would be

(command “fillet” (car (entsel “\nSelect the first line: “))(entsel “\nSelect the second line: “)))

This still requires two clicks.

So, the problem now reduces to finding a method to select two lines with a single click.

Before trying in AutoLISP, let’s find out if we can do it manually. There seems to be no option or a work-around to do what we want.

Luckily, we have a single point (the intersection) that is common to both lines. So, let’s explore if we can somehow use the intersection point to select the 2 lines. If you have to click only one point to select multiple objects, obviously it should be the intersection point.

Study of selection methods shows that there are two options that base their selection on two points: crossing & window. Since W must include the objects fully, it won’t be suitable. So let’s try C option.

Use the SELECT command and then the c option and click on the intersection point in response to both points. AND …….. Both lines are selected!

The equivalent AutoLISP code would be

(setq ssLines (ssget “c” (setq pt1 (getpoint “\nSelect Intersection: “) ) pt1))

Now I can use each line to create a fillet.

(command “fillet” (ssname ssLines 0) (ssname ssLines 1))

And yes … the fillet appears!

Reducing clicks and increasing productivity in AutoCAD using AutoLISP

 

So, here is my simple program:

(defun c:FiletByPt ()

;;; creates fillet by single click

;;; ssk 110918

(setq ssLines (ssget “c” (setq pt1 (getpoint “\nSelect Intersection: “) ) pt1))

(command “fillet” (ssname ssLines 0) (ssname ssLines 1))

)

(prompt “\nCreates a fillet by single click. Type ‘FiletByPt'”)

Note: In the command name above, FiletByPt, “fillet” is intentionally spelled “filet” to avoid confusion as you start to type the custom AutoLISP command.

To use the above code, copy and paste it into Notepad and save it as filetbypt.lsp in a location that is in AutoCAD’s support file search path. Instructions for loading the program are here.

However life is always not so simple. The lines may extend beyond the intersection point. My R&D shows that the above code still works as shown in Fig. 3.

AutoCAD tip: Reduce clicks and increase productivity in AutoCAD with AutoLISP

It even works when the two lines are not perpendicular.

When two lines are selected using a single point, AutoCAD finds and trims shorter segments of each line and then creates a fillet between the two remaining segments.

There might be situations (when two lines meet at the midpoint) where the code may not work or possibly needs modification.

But, if creating fillets is a major task for you, and saving 50% of time can result in significant gain, go ahead and use this code.

Are you stuck-up with such trivial tasks that are strain on your resources? Let me know and we’ll see if I can help you with useful hints or sample code.

Sanjay Kulkarni is an experienced CAD (AutoCAD, Inventor, SolidEdge, CATIA, NX) programmer and a member of the Autodesk Developer Network. He is fluent in AutoLISP, VBA, and VB.NET. He has written for AugiWORLD and Inside AutoCAD. He can be contacted at sanganaksakha@gmail.com