Inventor In-Depth: Tips for Customizing Template Parts

12 Feb, 2006 By: Cadalyst Staff Cadalyst

Make templates that save even more time when creating drawings

Many Microsoft Windows applications include templates that make customizing and setting defaults easier. You can use templates to tailor how Autodesk Inventor files behave as well. Powerful settings and changes you can make in your part (IPT) templates help you get more out of your use of Autodesk Inventor.

The following are tips for modifying templates for your designs.

Turn on Origin Planes
When creating part models, it's good practice to reference work planes and origin planes as much as possible. To make it easier, turn on the origin planes.

  1. In the browser select the Origin folder to open its contents.
  2. Select the three origin planes and then select Visibility from the Model menu (figure 1).

Figure 1. Make all three origin planes visible for easy reference.

Project the Origin Point
It's helpful to have the origin point available for sketch constraints when you make new parts from a template. And it ensures the best practice of constraining sketch features to the origin. Here's how to make the origin point automatically available.

  1. In your part file, delete the default sketch and create a new sketch on the origin plane that most commonly represents the front view for you.
  2. While this new sketch is active, use the Project Geometry command to project the origin point (figure 2).

Figure 2. Make the origin point available to ensure you limit sketch features to the origin.

Set Your Own Isometric View
At times you may want to redefine the default isometric view.

  1. From the standard toolbar, select the Rotate View command (do not use the F4 keyboard accelerator). A circular navigation aid will appear.
  2. Press the space bar and the navigation aid will switch to the Common View tool (it looks a lot like the glass box).
  3. Using the Common View tool, select any isometric view at any orientation.
  4. Once you have selected the desired isometric view, use the context menu to select Redefine Isometric (figure 3).

Figure 3. Redefine isometric views to suit your needs.

Set Dimension Display
You can display Autodesk Inventor part features and sketch dimensions in different ways according to preference. I prefer to display dimensions as an expression where I can see the dimension name and the parametric formula that might be driving it. Another popular display shows the dimension with its tolerance.

  1. From the Tools menu, select Document Settings.
  2. Switch to the Units tab. From the Modeling Dimension Display pane, choose the option that best suits your preference for default dimension display (figure 4).

Figure 4. Tailor dimension display conditions for your requirements.

Set Default Tolerances
Customizing default tolerances for dimension values helps you match part feature and sketch dimensions to your company's standards with appropriate precision.

  1. From the Tools menu, select Document Settings.
  2. Switch to the Default Tolerance tab.
  3. Add your tolerances and set the default values.

Tip: If you use Autodesk Vault, you may want to search for files based on these default tolerances. Check the box for Export Standard Tolerance Values (figure 5) to write the tolerance precision and default tolerance value as custom properties. The next time you check the file into your vault, these characteristics will appear as searchable properties.

Figure 5. Export standard tolerance values if you want to search for documents with these properties in Autodesk Vault.

Set Material and Color Style
To make your mass properties more accurate, set the parts material in the Styles and Standards Editor (figure 6). I set my template to Steel, and I prefer to use a non-shiny color style, such as Blue (Sky).

Figure 6. Set material and color defaults for more accurate mass properties.

To further customize your templates, you can add more properties. Here's how.

Create Custom Properties
Custom properties are useful for adding information to bills of materials, parts lists and other drawing annotations.

  1. Within the Properties window, click the Custom tab.
  2. Decide what information you want to add, then create the properties to hold the information (figure 7).

Figure 7. Add custom properties to add useful data to bills of materials and other annotations.

Customize File Functions
Users often ask how to add mass as a custom property so they can use it in drawing annotation and title blocks as well as search for drawings with specific mass properties in Autodesk Vault.

Autodesk Inventor includes Visual Basic Editor, an environment for creating simple customizations quickly -- including customization of templates. By embedding Microsoft Visual Basic code into an Autodesk template, you can execute customization in conjunction with opening, closing or saving a model. The example that follows illustrates Visual Basic code that executes every time a file is saved. Because this code is embedded in the custom template, every new part file created from the custom template will include it. This automatic inclusion ensures that all files update and fill in their custom mass properties.

  1. Start by making sure the file you are customizing remains open.
  2. From the Tools menu, select Macro and then Visual Basic Editor. You also can press ALT + F11 as a keyboard shortcut to launch the Visual Basic editor.
  3. Locate the panel called Project and expand the DocumentProject folder.
  4. Open the Modules folder and double-click the Functions folder to activate the editor window (figure 8).

Figure 8. Choose the Functions module to launch the Visual Basic editing tool.

  1. In the Visual Basic Editor window, copy and paste the following code. This subroutine will run automatically every time the part is saved (and the name must appear exactly). The subroutine is written to fill in the property value with the part's mass and convert the unit of measure from kilograms (Autodesk Inventor default) to pounds.

    Public Sub AutoSave()
     ' Obtain the PropertySets collection object
     Dim oPropsets As PropertySets
     Set oPropsets = ThisDocument.PropertySets
     ' Get a reference to the "Custom Mass Property" 
     Dim oProp As Property
     Set oProp = oPropsets.Item("{D5CDD505-2E9C-101B-
     ' Assign property to Inventor's mass, convert it to 
          LBS from Kg and round to 3 places
     oProp.Value = Round(ThisDocument.ComponentDefinition.
          MassProperties.Mass * 2.20462262, 3) & " lbs"
    End Sub

  2. Close the Visual Basic Editor.
  3. Save the part file.
  4. Open iProperties from the File menu. Switch to the Custom tab, and you will see that the mass is filled in. Also note that the part tolerances and their default values are visible (figure 9).

Figure 9. Once added, customized properties are displayed among a part's values.

Last but not least, save the customized part template to a place where you can use it in future.

  1. Select File / Save As and browse to your Inventor install location. You should see a template subfolder there (the default is C:\Program Files\Autodesk\Inventor 10\Templates).
  2. Give your file a meaningful name. (Do not overwrite the STANDARD.IPT file -- you may need it in future.)
  3. Close the file. Select File / New. Select the customized template from the pane and double-click on it. You should see all of the customizations.

Customizing Autodesk Inventor templates is just one of the many ways that you can adapt Autodesk Inventor to save you time and boost productivity. Talk with your peers or your CAD manager to see if some of these tips might benefit your entire department.

About the Author: Cadalyst Staff

Cadalyst Staff

More News and Resources from Cadalyst Partners

For Mold Designers! Cadalyst has an area of our site focused on technologies and resources specific to the mold design professional. Sponsored by Siemens NX.  Visit the Equipped Mold Designer here!

For Architects! Cadalyst has an area of our site focused on technologies and resources specific to the building design professional. Sponsored by HP.  Visit the Equipped Architect here!