SolidWorks Express
CAD Tips for the week of January 20, 2009
 
Lift a Layout: You can copy an entire layout tab from one 2D drawing to another. Right-click on a layout tab in the destination drawing and select the From Template option >>
Picky Pickfirst: The PICKFIRST system variable controls when you select objects relative to starting a command. When PICKFIRST is set to 0, you select objects after you start a command. When PICKFIRST is set to 1 (on), you can select objects either before or after starting a command >>
SHX Sleuthing: When you send a 2D drawing off to other users, it’s good practice to use the Pack and Go or eTransmit to bundle up all the associated files >>
Open the Right Folder: The AutoCAD system variable REMEMBERFOLDERS directs AutoCAD where to look first when you open or save a drawing >>
Display Doldrums: Defective video card drivers may cause display problems in AutoCAD and AutoCAD LT >>
Track Your Move: To adjust associative dimensions with precision, use AutoCAD’s tracking option. Click on the dimension you want to stretch, then select the grip of the definition point you want to stretch >>
   
 
> Lift a Layout
   
 

You can copy an entire layout tab from one AutoCAD drawing to another. Right-click on a layout tab in the destination drawing and select the From Template option.


Caption: Right-click any layout tab and select From Template.

The browse to the file you want to copy a layout from. A list of available layouts appears once you select a file.


Caption: When you select a drawing, a list of its layouts appears.

Select the layout tab you want and press OK. The layout you selected will appear in your current drawing.
   
 
> Picky Pickfirst
   
 

The PICKFIRST system variable controls when you select objects relative to starting a command. When PICKFIRST is set to 0, you select objects after you start a command. When PICKFIRST is set to 1 (on), you can select objects either before or after starting a command.

Selecting objects before the command starts is called noun/verb selection (and the opposite is—you guessed it—verb/noun selection).

Occasionally, sloppy AutoLISP programs can change the PICKFIRST setting to 0, but neglect to return it to 1 at the end of the routine. The variable may also get stuck on 0 if you end an AutoLISP routine by pressing ESC (in this case, the routine lacks an error handing section that resets all variables before the program ends). It’s also possible that the system variable setting is changed when you open a drawing template or load a profile.

A setting of 0 can cause all sorts of strange problems. Check your PICKFIRST setting when:

  • You double-click on an object and nothing happens.
  • You click on an object, but its layer doesn’t display in the pull-down list.
  • You select an object and press the Delete key, but nothing happens.
  • Mvsetup doesn’t work the way you expect it to—for example, you can’t change the viewport scale in paper space and/or you can’t change the viewport’s layer.

To set PICKFIRST to 1, type PICKFIRST at the command prompt and enter a new value of 1. You can also select Options from the Tools menu. Select the Selection tab and under Selection Modes check the Noun/Verb check box.

Caption: Turn PICKFIRST on by checking the Noun/verb selection box in the Selection tab of the Options dialog box.
   
 
> SHX Sleuthing
   
 

When you send an AutoCAD drawing off to other users, it’s good practice to use the Pack and Go or eTransmit to bundle up all the associated files (xrefs, fonts, etc.). Sadly, not everyone is well-versed in file transfer etiquette, and you may find yourself the recipient of a drawing that’s missing some shape (SHX) files. This problem can also occur when you misplace or delete the SHX files.

Note that AutoCAD uses two kinds of SHX files. AutoCAD fonts are compiled as SHX files. However, you are most likely being prompted to find a shape file. Shape files are objects, similar to blocks, that are usually part of a linetype definition.

Every time you open such a drawing, you will be prompted to find those missing files. The first solution is to locate the missing SHX files. If the drawing came from an outside source, ask that source to send the missing files. If it’s an internal drawing, search your computer and servers for the missing file. You can find the name in file name box in the Select Shape File dialog box that appears when you open the drawing.

If you can’t locate the missing file, you can try to remove the missing shape from the drawing. Do this only if you are sure that removing the shape won’t affect the integrity of the drawing. Also do this only on a copy of the drawing in case you are mistaken about the effects of removing the shape.

First, try running the Purge command. If the shape is not listed, check your complex linetypes. Try purging all linetypes, then see if the shape file is listed.

If that doesn’t work, run Qselect and see if any Shape entities appear in the drawing. If they do, you can select and delete them.

If that doesn’t work, here’s an AutoLISP routine provided by Autodesk that erases shape objects that reference unavailable shape files and purges references to unavailable shape files. Create a new text file in a text editor such as Notepad and paste in the following:

;;;---------------- START OF FILE ------------------------
;;; DESCRIPTION
;;; This routine deletes all shapes in the drawing
;;; that do not have a file definition.
;;;
;;; RUN
;;; -load this file and run the new command DELSHAPE
;;;----------------------------------------------------------------------;

(defun c:delshape ()
  (setvar "CMDECHO" 0)
(setq n 0
  nshapes 0
  delete 0
)
(setq shapes (ssget "X" '((0 . "SHAPE")))) ;shapes
(setq shapes_name (ssget "X" (list (cons 0 "SHAPE") (cons 2 "*"))))
(if (/= shapes nil)
  (setq nshapes (sslength shapes))
) ; n. total de shapes
(if (and (= shapes_name nil) (/= shapes nil))
  (progn
    (while (< n nshapes)
  (setq entity (ssname shapes n))
  (entdel entity)
   (setq delete (+ 1 delete))
   (setq n (+ 1 n))
    )
  )
)
(while (and (< n nshapes) (/= shapes nil) (/= shapes_name nil))
  (setq entity (ssname shapes n))
  (if (or (= (ssmemb entity shapes_name) nil))
    (progn
  (entdel entity)
  (setq delete (+ 1 delete))
    )
  )
  (setq n (+ 1 n))   )
  (prin1 delete)
  (princ " shape(s) deleted\n")
  (command "_purge" "_sh" "" "_n")
) ;;---------------- END OF FILE --------------

Save the text file as delshape.lsp and use the Appload command to load the routine in AutoCAD. Type Delshape at the command line. When it’s done, the routine will display the number of shapes erased and the number of shape files purged at the command line. It will delete only shapes that reference unavailable shape files. It won’t delete shapes that display.
   
 
> Open the Right Folder
   
 

The AutoCAD system variable REMEMBERFOLDERS directs AutoCAD where to look first when you open or save a drawing. When the variable is set to 1, AutoCAD remembers the folder where the last drawing you opened resides (default location is My Documents). That folder comes up when the Select File dialog box is displayed. This memory is retained even after you close AutoCAD.

When REMEMBERFOLDERS is set to 0, AutoCAD always goes to the folder specified in the Start In field in the Properties dialog box of the icon used to start the program. Set the start in folder as follows:

  • Right-click on the AutoCAD icon on your desktop. You can make as many AutoCAD desktop icons as you want—just be sure to give them unique names so you can tell what each one does.
  • In the Start In field, enter the path and folder name you want AutoCAD to go to whenever you open or save a drawing.
Note that when REMEMBERFOLDERS is set to 1, AutoCAD will ignore the folder specified in the shortcut icon.
   
 
> Display Doldrums
   
 

Defective video card drivers may cause display problems in AutoCAD and AutoCAD LT. Suspect the driver when objects don’t display when you draw them or don’t disappear when you erase them. Bad drivers can also cause your computer to lock up with no warning, particularly when you run commands such as Move or real-time Pan that make the display regenerate.

You can turn off hardware acceleration within AutoCAD. In AutoCAD 2007 and above, type 3dconfig at the command line. In the dialog box that appears, click Manual Tune.


Caption: Select Manual Tune, the middle button in the right panel.

Then uncheck the Enable Hardware Acceleration box.


Caption: Uncheck the box at the very to turn off hardware acceleration.

Select OK to exit the dialog boxes, then restart AutoCAD. For earlier versions, select Options from the Format menu. On the System tab, select Properties under Current 3D Graphics Display. Under Acceleration, select Software. Again, you’ll need to restart the program.

In AutoCAD 2007 and up, you have the option of turning hardware acceleration off only at startup. Create a new shortcut icon for AutoCAD on your desktop. Right-click the new icon and select Properties from the Shortcut menu that appears. Find the Target box and go to the end of the string that resides there. Add the following to the end of the string (be sure to leave a space before the slash):

/nohardware

If turning video acceleration off fixes your display problem, check the Web site of your video card’s manufacturer for updated drivers. Also check for updates to your versions of Windows and AutoCAD.
   
 
> Track Your Move
   
 

To adjust associative dimensions with precision, use AutoCAD’s tracking option. Click on the dimension you want to stretch, then select the grip of the definition point you want to stretch. At the command prompt, enter TK (for tracking) and press Enter.

Caption: Select the dimension grip point, then type TK at the command line.

Select the other dimension definition point grip and drag the cursor in the direction you want to stretch the dimension. Type in your desired dimension length, then press Enter twice.

Caption: Move the cursor in the direction you want to move the dimension, then enter a distance in units at the command line.

Press Escape to end the command. The dimension will move the distance you specified.

Caption: The dimension moves the distance you specified.
   
 
   
 
 
>> SIGN UP for SolidWorks Express Newsletter and get the tips and tricks delivered into your inbox every two weeks!