Automate meshing with selection recipes and template files
Learn how to use selection recipes together with template files to automate tasks required to mesh a finite element model.
Open the part file
Open the part file.
Define attributes in the part file
Define material and thickness attributes of the structure.
Create a FEM file
Create a FEM file and verify the inherited attributes.
Create the selection recipes
Create the selection recipes based on the attributes that you previously defined.
Create the meshes
Create meshes for upper and lower surfaces using the selection recipe that facilitates the selection of the surfaces.
Create materials and assign them to the corresponding collector
Create material named 2024T3 and 7075P6.
Disconnect the FEM and CAD files
Break the association between the FEM and the selected CAD source part to use the FEM file as a template.
Add a custom template file to a .pax file
For CAE applications, template files contain the settings and the FE modeling definitions that you need to define an analysis. The .pax file is an XML file that defines the FEM and Simulation file templates that the software loads automatically when you create a new part file with a template. You will customize the .pax file by editing the XML content with a text editor to add entries that point to your own custom template file.
Change the templates folder directory
Redirect the default template directory to your current working folder to avoid modifying the default templates.
- Click Windows Start.
- Type env in the Windows search box and select Edit environment variables for your account.
- Create a new variable called: UGII_TEMPLATE_DIR.
- Set its value to the .../selection_recipe/Template folder.
- Click OK to all windows.
- Start the software.
Create a new FEM file using the template
Create a new FEM using the customized template.
Remove the user defined templates
Remove the UG template environmental variable from the system to return to the preset templates. For other activities or your daily work you may not need the templates you defined.
- Click Windows Start.
- Type env in the Windows search box and select Edit environment variables for your account.
- Select UGII_TEMPLATE_DIR.
- Click Delete.
- Click OK twice.
- Restart the software for your next labs.




