Custom Tools
Version 11.3.2
Proprietary and Restricted Rights Notice
This software and related documentation are proprietary to Siemens Product Lifecycle Management Software Inc.
© 2014 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
Siemens and the Siemens logo are registered trademarks of Siemens AG. NX is a trademark or registered trademark
of Siemens Product Lifecycle Management Software Inc. or its subsidiaries in the United States and in other coun-
tries. All other trademarks, registered trademarks or service marks belong to their respective holders.
Siemens PLM
Web: http://www.femap.com
Customer Support
Web: http://support.ugs.com
The following copyright refers only to the “bmp2raster.exe” executable distributed with FEMAP:
NeuQuant Neural-Net Quantization Algorithm
Copyright (c) 1994 Anthony Dekker
NEUQUANT Neural-Net quantization algorithm by Anthony Dekker, 1994.
See "Kohonen neural networks for optimal colour quantization" in "Network: Computation in Neural Systems"
Vol. 5 (1994) pp 351-367 for a discussion of the algorithm.
See also http://members.ozemail.com.au/~dekker/NEUQUANT.HTML
Any party obtaining a copy of these files from the author, directly or indirectly, is granted, free of charge, a full and
unrestricted irrevocable, world-wide, paid up, royalty-free, nonexclusive right and license to deal in this software
and documentation files (the "Software"), including without limitation the rights to use, copy, modify, merge, pub-
lish, distribute, sublicense, and/or sell copies of the Software, and to permit persons who receive copies from any
such party to do so, with the only requirement being that this copyright notice remain intact.
Conventions
This manual uses different fonts to highlight command names or input that you must type.
OK, Cancel Shows a command name or text that you will see in a
dialog box.
Throughout this manual, you will see references to Windows. Windows refers to Microsoft® Windows XP, Win-
dows Vista, Windows 7, Windows 8, and Windows 8.1 (32-bit and 64-bit versions). You will need one of these
operating environments to run FEMAP for the PC. This manual assumes that you are familiar with the general use
of the operating environment. If you are not, you can refer to the Windows User’s Guide for additional assistance.
Similarly, throughout the manual all references to FEMAP, refer to the latest version of our software.
Table of Contents TOC-1
Table of Contents
1. Introduction
This section introduces the API scripts contained within the API folder in FEMAP.
The Custom Tools toolbar can also be activated or deactivated through the Tools, Toolbars command. When the Customize
dialog box is activated, click the Toolbars tab, then click the check box for the Custom Tools menu.
1-4 Introduction
• When the Custom Tools menu is selected, the newly added program file has been added to this menu. Note that all files
added to the Custom Tools menu are arranged by alphabetically.
Custom Tools > Data Table 2-1
This section provides an overview of the Data Table API scripts under the Custom Tools, Data Table toolbar menu.
2.2 AddNodesandDisplacementstoDataTable
This API .bas script populates the Data Table with the X, Y, and Z coordinates and displacements of selected nodes.
This section provides an overview of the API scripts used modify element property attributes, types and display
attributes under the Custom Tools, Element Update toolbar menu.
3-2 Custom Tools > Element Update
3.1 AlignSolidElemCsysToSurfaceTangents
This FEMAP API .bas script creates a Csys at the centroid of the selected element(s) aligned with the selected sur-
face U and V tangent directions at the projected element centroid. The Csys is used to create a Solid property with
its material angle aligned with the Csys.
3.12 RenumberNodesAndElements
This API .bas script renumbers all nodes and elements in the active model by the selected order and coordinate sys-
tem.
This section provides an overview of the Event Callback API scripts under the Custom Tools, Event Callbacks tool-
bar menu.
4.1 callback
This API .bas script checks for existence of variables (ITER, K, K1, K2, and PID) in the active FEMAP model file.
If these variables exist, an IF statement is run against K1 <= K <= K2. If the test passes and an active Analysis Set
exists in the FEMAP model, then the API script renames the active Analysis Set to the value of the callback
returned with the method App.feAppEventCallback (FEVENT_RESULTSEND, “”).
4.2 Startloop
This API .bas script checks for Shell properties in the active FEMAP model file, then prompts the user to enter a
starting value for the thickness of a selected Shell property, the ending value of the thickness and the number of
iterations from the stating to the ending value.
4-2 Custom Tools > Event Callback
The API uses the App.feAppEventCallback (FEVENT_RESULTSEND,path) call modifies the name of the analy-
sis set and result set as it iterates from the Starting Thickness to the Ending Thickness.
Custom Tools > Examples 5-1
This Custom Tools API .bas scripts contain basic examples of using FEMAP’s API to develop custom applications.
These Custom Tools API scripts provide tools to automate FEMAP geometry creation and editing operations.
Resulting model with red surfaces indicating surfaces continuously tangent to the selected surface.
Free Edges of Sheets to Groups 7-3
7.8 SliceSolidsUpdateLayersAndGroups
This FEMAP API .bas script slices a selected solid with a user-specified plane, and assigns the resulting solids to
the selected solid’s layer and group(s)
After selecting the “from” and “to” coordinate systems are selected and the bracket is selected, the “from” and the
bracket are transformed as shown below.
Custom Tools > Grouping 8-1
These Custom Tools API scripts provide tools to automate FEMAP Group rule modifications.
8.9 GroupRigidIndependentNodes
This FEMAP API .bas script appends to the active group, or creates a new group of independent node(s) on rigid
element(s) in the active FEMAP model file.
8.10 GroupSurfacesWithSelectedRadius
This FEMAP API .bas script creates a group of cylindrical surfaces with a user-specified radius.
In the Session File section, use the Select File button to select the Patran Session File (*.ses file) using a “Standard
Windows Select File” dialog box.
Property to Layers 8-3
The Options section has three sections: Group Geometry, Group Finite Elements, and the Verbose option.
Group Geometry - choose to import Points, Curves, and/or Surfaces by checking the appropriate check boxes.
Click the All On button to enable all three entity types or All Off to disable all three entity types.
Group Finite Elements - choose to import Nodes and/or Elements/MPCs by checking the appropriate check
boxes. Click the All On button to enable both entity types or All Off to disable both entity types.
Verbose option - when enabled, will issue messages as each new group is created or each existing group is
updated, along with any error messages. When disabled, only error messages will be issued.
This FEMAP API .bas script follows the NASA FEMCI (Finite Element Modeling Continuous Improvement)
guidelines for representing a composite honeycomb sandwich with a NASTRAN PSHELL. For further information
on this method, go to http://femci.gsfc.nasa.gov/hcplate/index.html.
9-2 Custom Tools > HoneyComb PSHELL > HoneyComb PShell Property
The resulting PSHELL property results as follows given the data entries in the snapshot of the dialog box:
9-4 Custom Tools > HoneyComb PSHELL > HoneyComb PShell Property
Custom Tools > Import then Connect Startup 10-1
These Custom Tools API scripts provide tools to automate FEMAP load creation.
11-2 Custom Tools > Load Processing
highest Y-coordinate value of nodes in the model. This API script requires that an active load set be present in the
active FEMAP model.
These Custom Tools API scripts provide tools to automate FEMAP meshing.
12-2 Custom Tools > Meshing
12.1 Auto Boundary Faces With Poles, Auto Boundary Faces With
Poles
This FEMAP API .bas script finds all surfaces with poles and applies the feBoundaryFromSurfaces method to
those surfaces.
12.2 Auto Boundary Faces With Poles, Select Auto Boundary Faces
With Poles
This FEMAP API .bas script is similar to Custom Tools, Auto Boundary Faces With Poles, Auto Boundary Faces
With Poles, except that the user selects the surfaces to check for poles.
12.15 ShowBadTetras
This FEMAP API .bas script checks for element distortion using the API feCheckElemDistortion function for any
elements with a Jacobian at or above a value of 0.7. Any elements exceeding this limit are placed into a distorted
element group and the distorted element group is highlighted in the graphics pane.
12.20 Spider
This FEMAP API .bas script operates identically to the API script, Spider Nodes.
When Check Type is set to Nastran, the script parses through an *.f06 file and searches for specific text (a text
“string”) that identifies elements with “points” lying outside of the “patch” or elements with projections which
have “failed”. Examples of the text:
When Use Existing is selected in the f06 File section, the user will be prompted to select an existing *f06 file.
When Run New is selected in the f06 File section, the script creates a temporary Analysis Set, exports an input file,
then checks the corresponding *.f06 file for the text shown above.
When Check Type is set to Standard, the script identifies whether the model contains weld, fasteners, or both, then
uses a different “check” based on each distinct element type.
For welds, the script checks for “points lying outside of the patch” by generating eight FEMAP point entities along
the diameter of the weld on both ends, and uses the cross products and dot products of the element edges and point
locations to determine whether each point lies inside the “patch” boundaries. To check for “elements with failed
Weld-Fastener Element Generator 12-7
projections”, the API uses the previously stated method, but instead checks if the center of each weld “end” lies
within the “patch boundaries”.
For fasteners, the API compares the fastener diameter to the shortest distance between the “closest elements’” cen-
troids and edges, and “flags” the fastener if its diameter exceeds that of the “shortest distance”.
The Failed Elements section is used to determine what should be done with any elements which fail the selected
Check Type. By default, the script will simply List the failed elements, but there are also options to Show the failed
elements (highlight the elements in the graphics window) or both List/Show the elements. When Create Group(s) is
enabled, the elements which fail will be placed into newly created groups. When Delete Elements is enabled, the
element which fail will be deleted. If you have Check Type set to Nastran and have also chosen to delete failed ele-
ments, you may want to also turn on Iterate, which will keep running new check runs until no elements which fail
the Nastran checks for Weld and/or Fastener elements occur.
The Weld/Fastener section is simply used to select the type of elements which will be created, Weld elements or
Fastener elements.
The Weld/Fastener Location Method section allows selection of a method to determine weld or fastener locations,
along with some additional options. Any number of XYZ coordinates may be stored in a FEMAP Data Surface, an
Excel spreadsheet, or a CSV (Comma-Separated Values) file. When one of these location methods is used, an ele-
ment will be created for each valid location found in the selected Arbitrary 3-D Data Surface, *.xls file, or *.csv
file, respectively. To simply enter coordinates one-at-a-time, select Individual and the script will then later prompt
the you for a location using the standard coordinate definition dialog box.
Regardless of the Weld/Fastener Location Method selected and other options, you will always be prompted to
select a Material after clicking OK to the Locate - Select Weld/Fastener Location Method dialog box. When creat-
ing Welds, you will then be prompted for a Diameter. When creating Fasteners, the Fastener Property Parameters
dialog box also be displayed:
This dialog box allows you to specify values for Diameter, Mass, Structural Damping, KTX, KTY, KTZ, KRX, KRY,
and KRZ, along with a toggle to Use Material CSys, a drop-down to choose a Material CSys, and the Absolute tog-
gle. These values, other than Diameter, will be used for all fastener elements created by a single use of this script.
12-8 Custom Tools > Meshing
If using Data Surface, Excel, or CSV, the Use Column 4 Diameter Values option is available. When disabled, which
is the default, you will be prompted for a single diameter value which will be used for all elements. When enabled,
you will still be prompted for a diameter, which will be used as the “default”, but you may also specify a different
diameter in “Column 4” for each location.
When Use Column 4 Diameter Values is enabled, the Consolidate Properties option will become available. When
disabled, which is the default, a unique property will be created for each newly created element. When enabled, the
script will attempt to create as few new properties as possible, then apply them to the appropriate elements. Speci-
fying a 0.0 or an “empty cell” in “Column 4” of the corresponding file format will default the diameter to the value
specified in the Enter Diameters for CWELD/CFAST Element dialog box.
The Check for Failed Elements option, when enabled, will run through a process similar to the Weld-Fastener Ele-
ment Check API script, described above in 12.21 Weld-Fastener Element Check.
File formats:
Data Surface - Must be an Arbitrary 3-D Coordinates Data Surface. X, Y, and Z coordinates are entered into the X,
Y, and Z Location fields in the Define Arbitrary 3-D Coordinates Data Surface dialog box. Optionally, a diameter
for each location may be defined in the X Value field and will be used when the Use Column 4 Diameter Values
option is enabled.
Weld-Fastener Element Generator 12-9
Optionally, a diameter for each location may be defined in “Column E” and will be used when the Use Column 4
Diameter Values option is enabled.
CSV - Use the following format:
Optionally, a diameter for each location may be defined in the 5th field and will be used when the Use Column 4
Diameter Values option is enabled.
How it works:
Using the user-specified coordinates, the script finds the closest “node” to that location, and adds all of the ele-
ments using that node to a Set object. Through the App.feMeasureDistance call, the program calculates the distance
between each element's centroid to the user-specified coordinate, and chooses the element with the shortest corre-
sponding distance as the first “patch” element for the weld/fastener. To find the adjacent “patch” element, the user-
entered coordinate is then projected in the direction of the “closest element's” normal vector, until it finds the next
“closest node”. The script repeats this process for choosing the “closest” element using the second “closest node”.
For weld elements, the script then uses Weld Type set to “3..Patch to Patch (ELPAT)” and specifies the two closest
elements' IDs as the corresponding “Elem IDs” for “Patch 1”and “Patch 2”. It uses the “Projection” location
method to orient the weld between the two patches.
12-10 Custom Tools > Meshing
For Fastener elements, the script uses Weld Type set to “7..Elem to Elem (CFAST, ELEM)” fastener type, and spec-
ifies the two closest elements' IDs as the corresponding “Elem IDs” for “Patch 1” and “Patch 2”. While it also uses
the “Projection” location method, the fastener element is always oriented along a line connecting the two elements'
centroids.
Custom Tools > Model Query 13-1
These Custom Tools API scripts provide tools to automate model display, output, Analysis Set editing and model
query and checking operations.
13-2 Custom Tools > Model Query
13.10 GroupShowAllConnectedElements
This FEMAP API .bas script prompts the user to select a single element. All elements sharing nodes with the
selected element and adjacent elements are placed into a new group, All Mesh Connected to Elem nnn, where nnn is
the ID of the selected element. Connected elements are highlighted using the feViewShow function.
13.12 LSDyna_Time_Step_Calculator
This FEMAP API .bas script calculates the minimum time step required for a LS Dyna analysis.
13-4 Custom Tools > Model Query
13.15 ShowConnectedElems
This FEMAP API .bas script is similar to the API script, GroupShowAllConnectedElements, except it only high-
lights the adjacent elements, and not all the elements connected. It also does not create a group of connected ele-
ments.
Custom Tools > Node Update 14-1
These Custom Tools API scripts provide tools to automate the creation and modification of nodes.
15.8 GROUP_POST_FNO
This API .BAS script allows selection of a particular group for post-processing, then creates a new model file with
only the entities in the group (along with any entities needed to make a valid model in a new model) and attaches a
FEMAP Neutral File Output (FNO) file with the selected output.
After the group is selected, a copy of that group is made for temporary use and the “Group, Operations, Add
Related Entities” is run on that group (this group is later deleted by the script). This group is used to create a “valid”
model in the new FEMAP model. A FEMAP Neutral Output (FNO) File is then created containing the output sets
and output vectors selected using the Select Output to Export dialog box. From there, the script creates a new
model file in FEMAP with only the entities from the selected group and then attaches the FNO file to allow for
post-processing on those entities in the group.
15.22 Sum Contact Grid Point Forces, Sum AdvNonlin Contact Force
This API .bas script list the sum of contact forces on selected surfaces for the active Advanced Nonlinear Output
Set.
15.23 Sum Contact Grid Point Forces, Sum AdvNonlin Contact GPF
On Connector
This API .bas script lists the sum of contact force on selected connectors for the active Advanced Nonlinear Output
Set.
15.24 Sum Contact Grid Point Forces, Sum Contact GPF On Connec-
tor
This API .bas script lists the sum of Grid Point Forces for the nodes on selected connectors for the active Advanced
Nonlinear Output Set. Force Balance must be part of the Output Requests for the Advanced Nonlinear Analysis
Set.
These API scripts automate the setting of surface on solids transparency and colors.
16-2 Custom Tools > Solid Connection Tools
These API scripts automate the generation of Analysis Sets and analyses.
These API scripts automate the generation and contour plotting of model load and element thicknesses. In addition,
they can be used to “fly through the inside of a model” for visualization purposes.
19.1 FlyAroundPlayback
This API .BAS script allows you to playback recorded view manipulations which were recorded using the Custom
Tools, Visualization, FlyAroundRecord.bas API script. Simply enter the ID of recorded view manipulations.
19.2 FlyAroundRecord
This API .BAS script allows you to record view manipulations such as zoom, pan, and rotate and saves them with a
user-defined ID which can then be played back using the Custom Tools, Visualization, FlyAroundPlayback.bas
API script.
19-2 Custom Tools > Visualization
19.3 FlyThroughAnimation
This API .BAS script allows you view a model by following a selected curve for a specified number of steps. To
work, at least one curve must already exist in the model. The process is to select a curve, then specify magnification
and rotation, then specify a number of steps, then finally click OK. The animation will begin as soon as you click
OK when specifying the number of steps.