SolidWorks Express
CAD Tips for the week of April 18th, 2011
 
Customization: Tweak Your Web Templates: If you are familiar with HTML coding, you can customize the templates provided in AutoCAD's Publish to Web wizard >>
Time-Saving Tip: Hurry Up Hatches When you are running the Hatch command, you can right-click to access some command options while you are in your drawing picking points or selecting objects >>
Drawing: Keeping It Flat: Keep in mind that even when you are drawing in the 2D workspace, you can still create 3D objects (objects with different z-coordinates) >>
Customization: Save Your Snap Settings: Once you get your Osnap settings just the way you want them, take a few seconds to make sure you can recover them quickly in case they change >>
   
 
> Customization: Tweak Your Web Templates
   
 

If you are familiar with HTML coding, you can customize the templates provided in AutoCAD’s Publish to Web wizard. The Publish to Web templates use the file extension PWT. There are four default templates:
In Windows Explorer, search for or browse to the Publish to Web template folder: PTWTemplates. Double-click the folder to open it. You should see the following subfolders:

    1. Template1. Contains the Array of Thumbnails template and a preview image. Array of Thumbnails creates a Web page that displays an array of thumbnail images.
    2. Template2. Contains the Array Plus Summary template, a preview image, and HTML frames. Array Plus Summary creates a Web page that displays an array of thumbnail images and summary information about each image.
    3. Template3. Contains the List of Drawings template, a preview image, and HTML frames. List of Drawings creates a Web page with a list of drawings and an image frame.
    4. Template4. Contains the List Plus Summarytemplate, a preview image, and HTML frames. List Plus Summary creates a Web page with a list of drawings, an image frame, and summary information about a selected image.

Be sure to create a backup before opening a template file to edit it. Right-click the folder you want to use, and select Copy from the shortcut menu that appears. Right-click the PTWTemplates folder, and select Paste from the shortcut menu. Right-click the copied folder to rename it. Open the folder and rename the PWT file to use the extension HTM.
Rename the PWT file to use the HTM extension so you can open it
Caption: Rename the PWT file to use the HTM extension so you can open it.
Open the template file using any HTML or text editor. The template contains comments that will help you figure out what you can modify and what you can’t (or shouldn’t).
Open the template file in a text or HTML editor. Watch for comments (Tips) that tell you what you can change
Caption: Open the template file in a text or HTML editor. Watch for comments (Tips) that tell you what you can change.
You can modify or add any of the following items:

    1. Images
    2. Text
    3. Hyperlinks
    4. Color
    5. Title
    6. Video/Animation

However, you can’t change the arrangement of images on the template page. For example, the Array of Thumbnails template presents the thumbnail images in rows across the page. You can’t change that presentation, but you can wrap text and graphics around the table of images.
When you’re done with your changes, save the template with a PWT extension. Make sure you save it in the template folder you created earlier. Each template folder can contain only one PWT file. If your folder contains more than one PWT file, delete the extras.
When you run the Publish to Web wizard, your new template will appear in the list of templates.
Your custom template will appear in the list of templates available in the Publish to Web  wizard

Caption: Your custom template will appear in the list of templates available in the Publish to Web  wizard.
   
 
> Time-Saving Tip: Hurry Up Hatches
   
 

When you are running the Hatch command, you can right-click to access some command options while you are in your drawing picking points or selecting objects. This shortcut menu can save you time by eliminating the need to return to the Hatch dialog box.

Hatch command

 

Options in the shortcut menu do the following:
Enter: Return to the Hatch dialog box.
Undo Last Select/Pick: Undo your most recent object selection or point pick.
Clear All: Undo all picksor object selections.
Pick Internal Point: Switch to picking internal points.
Select Objects: Switch to selecting objects.
Normal Island Detection: Set island detection to normal mode.
Outer Island Detection: Set island detection to outer mode.
Ignore Island Detection: Set island detection to ignore mode.

    1. Preview: Preview your hatch.
   
 
> Drawing: Keeping It Flat
   
 

Keep in mind that even when you are drawing in the 2D workspace, you can still create 3D objects (objects with different z-coordinates). When this happens, your dimensions will not be accurate and you may not be able to perform certain commands on objects with different z-coordinates. This can happen when you bring in objects from different drawings by inserting, importing, cutting and pasting, or attaching as an xref. These objects will come in with their assigned z-coordinate value. You may also be creating objects by snapping to objects that have a different z-coordinate value. You can eliminate this problem by setting the system variable OSNAPZ to 1. Type OSNAPZ at the command line, then enter 1. AutoCAD will ignore any z-coordinate value of any object you snap to. Instead it will use the z-coordinate value of your current UCS.

   
 
> Customization: Save Your Snap Settings
   
 

Once you get your Osnap settings just the way you want them, take a few seconds to make sure you can recover them quickly in case they change.
Your selections in the Object Snap Settings dialog box can determine the OSMODE value
Caption: Your selections in the Object Snap Settings dialog box can determine the OSMODE value.

The system variable OSMODE stores your object snap settings as the sum of the values of whatever snaps you have active:
         0     NONe
         1     ENDpoint
         2     MIDpoint
         4     CENter
         8     NODe
       16     QUAdrant
       32     INTersection
       64     INSertion
     128     PERpendicular
     256     TANgent
     512     NEArest
   1024     QUIck
   2048     APParent Intersection
   4096     EXTension
   8192     PARallel
Add the codes for the object snaps that you prefer to determine your OSNAP value. Then save this value so you can easily retrieve it. You can create a button or command that will restore your desired value.
To create a command, use the following syntax:
(defun C:XX()command "OSMODE" "nn"))

where XX is the command name and nn is the OSMODE value you want to set. You can add this string to you acad.lsp file so it will load and be available whenever you start AutoCAD.
Alternatively, you can assign the following macro to a button:
^C^C_osmode;xx;

where xx is your desired OSMODE value. You could make multiple buttons if you have different sets of preferred osnaps.

Type CUI at the command line to create a new command to apply your osnap settings (command is called osmode reset, as shown in the Command List window. In the Properties window, add the macro in the appropriate space. Here we are setting OSMODE to 770. Once your command is created, drag it from the Command List window to the destination toolbar in the Customizations window
Caption: Type CUI at the command line to create a new command to apply your osnap settings (command is called osmode reset, as shown in the Command List window. In the Properties window, add the macro in the appropriate space. Here we are setting OSMODE to 770. Once your command is created, drag it from the Command List window to the destination toolbar in the Customizations window.

 

Finally, you can use the following AutoLISP routine to save your current OSMODE system variable value to a text file:

^C^C^P(progn(setq OSFILENAME (open "c:/[insert desired file path here]/osmode.txt" "w"))
(write-line (itoa (getvar "osmode")) OSFILENAME)
(close OSFILENAME)

This one will retrieve a stored OSMODE value:

^C^C^P(progn(setq reados (open "c:/[insert desired file path here]/osmode.txt" "r"))

(setvar "osmode" (atoi (read-line reados)))(close reados))
   
 
   
 
 
>> SIGN UP for SolidWorks Express Newsletter and get the tips and tricks delivered into your inbox every two weeks!