Procedures might require you to enter input parameters, or they might have all inputs predefined. For example, the predefined meshing procedures require meshing rules as inputs. Scripts intended for use as procedures include a main block and might include an input definition. Two global variable definitions, SHAPE and FEM, are also available. The global variable SHAPE refers to the 3D Shape selection in the Batch Modeling dialog box. Use SHAPE for scripting geometry operations, such as defeaturing or midsurface extraction. The global variable FEM refers to the finite element model representation associated with a 3D Shape. Use FEM for finite element operations, such as creating meshes or property assignments for use in simulations. The global variable OCCURRENCE refers to the occurrence corresponding to the 3D Shape. Use OCCURRENCE for link services such as composing a link to created features. You can use the following input types:
The main block must be called main; it must include the same number of inputs and use the same input order as defined in the heading. An example format for a meshing procedure is shown below. '<Inputs> '<Input Name = "MeshingRule" Type="DmtDocument" SubType="CATFmtOct3DRule" Mand ="true" Nls ="Rule"/> '<Input Name = "Support" Type="Port" Mand ="false" Nls ="Support"/> '<Input Name = "IsProp" Type="Boolean" Mand ="false" Nls ="Create Property"/> '<Input Name = "NbLayers" Type="Integer" Mand ="false" Nls ="Number of layers:"/> '<Input Name = "Ratio" Type="Double" Mand ="false" Nls ="Ratio: "/> '</Inputs> Sub CATMain (iRule, iSupport, iIsProp, iNbLayers, iRatio) End Sub The meshing rule SubType is the extension of the DmtDocument—the file extension required for each type of meshing rule. The syntax for literals is as follows: '<Input Name = "MeshSize" Type="Dimension" SubType="Length" Mand="true" Nls="MeshSize"/> The Dimension type supports any kind of dimension, where the SubType specifies the kind of dimension. Enums are defined as follows: '<Input Name = "ElementOrder" Type ="Enum" SubType ="ElementOrder" Mand ="true" Nls ="ElementOrder"/> where ElementOrder is defined before the <Inputs> as: '<Enums> '<Enum Name = "ElementOrder"> '<Member Name = "Linear" Nls ="Linear"/> '<Member Name = "Quadratic" Nls ="Quadratic"/> '</Enum> '</Enums> |