CreateUserDefinedModel

Creates a user-defined model.

Note: This option can be used to create a UDM from a Discovery model (Modeler > Discovery Link).
UI Access Draw > User-Defined Model > [Model]
Parameters
Name Type Description
<Parameters> Array Structured array.

["NAME:UserDefinedModelParameters",

<definitionArray>,

<optionsArray>,

<geometryParamsArray>,

"DllName:=", <string filepath>,

"Library:=", <string>,

"Version:=", <string>

"ConnectionID:=", <string>]

<definitionArray> Array Structured array containing string "NAME:Definition"
<optionsArray> Array Structured array containing string "NAME:Options"

<geometryParamsArray>

Array

Structured array containing arrays for individual parameters:

["NAME:GeometryParameters",

["NAME:UDMParam",

"Name:=" , <string>,

"Value:=" , <string>,

"PropType2:=" , <integer>,

"PropFlag2:=" , <integer>]]

Required UDM parameters depend on the UDM being created. To see which properties apply to a UDM, right-click the UDM in the Project Tree and select Properties. Then select the Parameters tab.

PropType2 can be any of the following:

  • 0 – Property takes a string value.
  • 1 – Property is a menu option.
  • 2 – Property takes a number (integer or double).
  • 3 – Property takes a value (numbers, variables, or expressions).
  • 4 – Property is a file name.
  • 5 – Property corresponds to a check box.
  • 6 – Property specifies a 3D position.

PropFlag2 can be any of the following:

  • 0 – No flags
  • 1 – Read-only
  • 2 – Must be integer
  • 4 – Must be real
  • 8 – Hidden

PropFlag2 values can be combined. For example, a read-only property that must be an integer would take the value 3. A hidden property that must be real would take the value 12.

These values are further described in the UserDefinedPrimitiveStructures.h file included with the installation under "...\ANSYS Inc\v252\AnsysEM\UserDefinedPrimitives\Examples\Headers"

Return Value None

Python Syntax

CreateUserDefinedModel(<Parameters>)

Python Example

oEditor.CreateUserDefinedModel(

["NAME:UserDefinedModelParameters",

["NAME:Definition"],

["NAME:Options"],

["NAME:GeometryParams",

["NAME:UDMParam",

"Name:=" , "WaveguideRadius",

"Value:=" , "5mm",

"PropType2:=" , 3,

"PropFlag2:=" , 4

],

["NAME:UDMParam",

"Name:=" , "WaveguideLength",

"Value:=" , "10mm",

"PropType2:=" , 3,

"PropFlag2:=" , 4

],

["NAME:UDMParam",

"Name:=" , "FlareAngle",

"Value:=" , "32deg",

"PropType2:=" , 3,

"PropFlag2:=" , 4

],

["NAME:UDMParam",

"Name:=" , "NumberOfNotches",

"Value:=" , "12",

"PropType2:=" , 3,

"PropFlag2:=" , 2

],

["NAME:UDMParam",

"Name:=" , "WidthOfNotch",

"Value:=" , "1mm",

"PropType2:=" , 3,

"PropFlag2:=" , 4

],

["NAME:UDMParam",

"Name:=" , "DepthOfNotch",

"Value:=" , "2mm",

"PropType2:=" , 3,

"PropFlag2:=" , 4

],

["NAME:UDMParam",

"Name:=" , "WidthOfTooth",

"Value:=" , "2mm",

"PropType2:=" , 3,

"PropFlag2:=" , 4

],

["NAME:UDMParam",

"Name:=" , "WallThickness",

"Value:=" , "2.5mm",

"PropType2:=" , 3,

"PropFlag2:=" , 4

]

],

"DllName:=" , "HFSS/Antenna Toolkit/Horn/Corrugated.py",

"Library:=" , "syslib",

"Version:=" , "1.1",

"ConnectionID:=" , ""

])

Python Example of Creating a UDM from a Discovery Model

oEditor.CreateUserDefinedModel(

[

"NAME:UserDefinedModelParameters",

[

"NAME:Definition",

[

"NAME:UDMParam",

"Name:=" , "GeometryFilePath",

"Value:=" , "\"C:/Users/chenwan/Desktop/restored_files/tee.dsco\"",

"DataType:=" , "String",

"PropType2:=" , 0,

"PropFlag2:=" , 1

],

[

"NAME:UDMParam",

"Name:=" , "ProcessID",

"Value:=" , "255988",

"DataType:=" , "Int",

"PropType2:=" , 2,

"PropFlag2:=" , 8

]

],

[

"NAME:Options",

[

"NAME:UDMParam",

"Name:=" , "IsDiscoveryLink",

"Value:=" , "1",

"DataType:=" , "Int",

"PropType2:=" , 5,

"PropFlag2:=" , 8

],

[

"NAME:UDMParam",

"Name:=" , "Solid Bodies",

"Value:=" , "1",

"DataType:=" , "Int",

"PropType2:=" , 5,

"PropFlag2:=" , 0

],

[

"NAME:UDMParam",

"Name:=" , "Surface Bodies",

"Value:=" , "1",

"DataType:=" , "Int",

"PropType2:=" , 5,

"PropFlag2:=" , 0

],

[

"NAME:UDMParam",

"Name:=" , "Parameters",

"Value:=" , "\"eCADImportParameterType_Independent,eCADImportParameterType_None,eCADImportParameterType_Independent,eCADImportParameterType_All\"",

"DataType:=" , "String",

"PropType2:=" , 1,

"PropFlag2:=" , 0

],

[

"NAME:UDMParam",

"Name:=" , "Parameter Key",

"Value:=" , "\"\"",

"DataType:=" , "String",

"PropType2:=" , 0,

"PropFlag2:=" , 0

],

[

"NAME:UDMParam",

"Name:=" , "Named Selections",

"Value:=" , "1",

"DataType:=" , "Int",

"PropType2:=" , 5,

"PropFlag2:=" , 8

],

[

"NAME:UDMParam",

"Name:=" , "Materials",

"Value:=" , "\"None,None,Assignments,Assignments and Properties\"",

"DataType:=" , "String",

"PropType2:=" , 1,

"PropFlag2:=" , 0

],

[

"NAME:UDMParam",

"Name:=" , "Import As Lightweight",

"Value:=" , "0",

"DataType:=" , "Int",

"PropType2:=" , 5,

"PropFlag2:=" , 0

],

[

"NAME:UDMParam",

"Name:=" , "Facet Level",

"Value:=" , "\"3,1,2,3,4,5\"",

"DataType:=" , "String",

"PropType2:=" , 1,

"PropFlag2:=" , 0

],

[

"NAME:UDMParam",

"Name:=" , "Cleaning",

"Value:=" , "0",

"DataType:=" , "Int",

"PropType2:=" , 5,

"PropFlag2:=" , 0

],

[

"NAME:UDMParam",

"Name:=" , "Use Parasolid For Transfer",

"Value:=" , "1",

"DataType:=" , "Int",

"PropType2:=" , 5,

"PropFlag2:=" , 8

],

[

"NAME:UDMParam",

"Name:=" , "Tolerant Stitching",

"Value:=" , "1",

"DataType:=" , "Int",

"PropType2:=" , 5,

"PropFlag2:=" , 8

],

[

"NAME:UDMParam",

"Name:=" , "Stitch Tolerance",

"Value:=" , "0.1",

"PropType2:=" , 3,

"PropFlag2:=" , 8

],

[

"NAME:UDMParam",

"Name:=" , "Tighten Gaps",

"Value:=" , "1",

"DataType:=" , "Int",

"PropType2:=" , 5,

"PropFlag2:=" , 8

],

[

"NAME:UDMParam",

"Name:=" , "Tighten Gaps Tolerance",

"Value:=" , "1e-06",

"PropType2:=" , 3,

"PropFlag2:=" , 8

],

[

"NAME:UDMParam",

"Name:=" , "Use Associativity",

"Value:=" , "1",

"DataType:=" , "Int",

"PropType2:=" , 5,

"PropFlag2:=" , 8

],

[

"NAME:UDMParam",

"Name:=" , "Attributes",

"Value:=" , "1",

"DataType:=" , "Int",

"PropType2:=" , 5,

"PropFlag2:=" , 8

],

[

"NAME:UDMParam",

"Name:=" , "Import Coordinate Systems",

"Value:=" , "1",

"DataType:=" , "Int",

"PropType2:=" , 5,

"PropFlag2:=" , 8

],

[

"NAME:UDMParam",

"Name:=" , "Decompose Disjoint Faces",

"Value:=" , "1",

"DataType:=" , "Int",

"PropType2:=" , 5,

"PropFlag2:=" , 8

],

[

"NAME:UDMParam",

"Name:=" , "Import Using Instances",

"Value:=" , "1",

"DataType:=" , "Int",

"PropType2:=" , 5,

"PropFlag2:=" , 8

],

[

"NAME:UDMParam",

"Name:=" , "Line Bodies",

"Value:=" , "1",

"DataType:=" , "Int",

"PropType2:=" , 5,

"PropFlag2:=" , 8

],

[

"NAME:UDMParam",

"Name:=" , "Mixed Import Resolution",

"Value:=" , "\"eMixedImport_None\"",

"DataType:=" , "String",

"PropType2:=" , 0,

"PropFlag2:=" , 8

],

[

"NAME:UDMParam",

"Name:=" , "Enclosure and Symmetry Processing",

"Value:=" , "1",

"DataType:=" , "Int",

"PropType2:=" , 5,

"PropFlag2:=" , 8

],

[

"NAME:UDMParam",

"Name:=" , "Reader Mode Saves Updated File",

"Value:=" , "0",

"DataType:=" , "Int",

"PropType2:=" , 5,

"PropFlag2:=" , 8

],

[

"NAME:UDMParam",

"Name:=" , "Smart CAD Update",

"Value:=" , "0",

"DataType:=" , "Int",

"PropType2:=" , 5,

"PropFlag2:=" , 8

],

[

"NAME:UDMParam",

"Name:=" , "Import Work Points",

"Value:=" , "1",

"DataType:=" , "Int",

"PropType2:=" , 5,

"PropFlag2:=" , 8

]

],

[

"NAME:GeometryParams"

],

"DllName:=" , "SACADIntegUDM",

"Library:=" , "installLib",

"Version:=" , "1.0",

"ConnectionID:=" , ""

])