Skip to main content

optiSLang 3D Postprocessing Script API 2025 R1

MacroArg Class Reference

Last update: 16.07.2025

a function argument of a macro More...

Public Types

enum  eDataType {
  STRING = 0, INT, FLOAT, BOOL,
  MATRIX, I_SCALAR_IDENT, I_SCALAR_IDENT_VECTOR, I_NODE_IDENT,
  I_NODE_IDENT_VECTOR, I_ELEMENT_IDENT, I_ELEMENT_IDENT_VECTOR, O_SCALAR_IDENT,
  O_SCALAR_IDENT_VECTOR, O_NODE_IDENT, O_NODE_IDENT_VECTOR, O_ELEMENT_IDENT,
  O_ELEMENT_IDENT_VECTOR, REMOVE_SCALAR_IDENT, REMOVE_NODE_IDENT, REMOVE_ELEMENT_IDENT,
  DATABASE, DESIGN_IDENT, FIELDMOP_NODE_IDENT, FIELDMOP_ELEMENT_IDENT,
  MOP_SCALAR_IDENT, RF_NODE_IDENT, RF_ELEMENT_IDENT, NAMED_SELECTION_NODE,
  NAMED_SELECTION_ELEMENT, UNKNOWN
}
 the enum data type for defining teh data type of the argument in script context More...
 

Public Member Functions

string help ()
 
string ident ()
 
 MacroArg (eDataType p_type, string p_ident, string p_help, string start="", string min="", string max="")
 constructor More...
 
 MacroArg ()
 default constructor
 
string max ()
 Get the maximum value as a string. More...
 
string min ()
 Get the minimum value as a string. More...
 
bool operator== (MacroArg arg)
 comparison operator More...
 
string start ()
 Get the start value as a string. More...
 
eDataType type ()
 
string type_string ()
 

Static Public Member Functions

static eDataType type_from_string (string s)
 

Detailed Description

a function argument of a macro

Member Enumeration Documentation

◆ eDataType

enum eDataType

the enum data type for defining teh data type of the argument in script context

Enumerator
INT 

< integer number, e.g. x = 1

FLOAT 

< floating point number, e.g. x = 1.1

BOOL 

< boolean, e.g. x = true

MATRIX 

< tmath.Matrix, e.g. x = tmath.Matrix({{1,1}{2,3}}

I_SCALAR_IDENT 

< a string

I_NODE_IDENT 

< a string

O_SCALAR_IDENT 

<

Constructor & Destructor Documentation

◆ MacroArg()

MacroArg ( eDataType  p_type,
string  p_ident,
string  p_help,
string  start = "",
string  min = "",
string  max = "" 
)

constructor

Parameters
p_typethe data type of the argument
p_identthe ident of ther argument/variable. This ident must be a single word, starting with a letter. It may contain numbers and underscores, and is case sensitive.
p_helpthe help string describing this parameter

Member Function Documentation

◆ help()

string help ( )
Returns
returns the help string

◆ ident()

string ident ( )
Returns
returns the ident

◆ max()

string max ( )

Get the maximum value as a string.

Returns
A string, empty, "inf", "-inf" or convertible to number

◆ min()

string min ( )

Get the minimum value as a string.

Returns
A string, empty, "inf", "-inf" or convertible to number

◆ operator==()

bool operator== ( MacroArg  arg)

comparison operator

Parameters
argthe variable to be tested
Returns
true if both are equal

◆ start()

string start ( )

Get the start value as a string.

Returns
A string, empty, "inf", "-inf" or convertible to number

◆ type()

eDataType type ( )
Returns
returns the type

◆ type_from_string()

static eDataType type_from_string ( string  s)
static
Returns
returns the enum from the given string
Parameters
sthe string to be converted. It is equal to s = type_string(type_from_string(s)), else exception.

◆ type_string()

string type_string ( )
Returns
returns the type as human readable string

Connect with Ansys