HyperWorks Solvers

Reference: String

Reference: String

Previous topic Next topic Expand/collapse all hidden text  

Reference: String

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  
hmtoggle_plus1greyXML Format

Model Element

Description

Reference_String defines a user defined text string in MotionSolve.  The string may be of any length.  It must contain only printable ASCII characters. Reference_String is primarily used within user defined subroutines. They are commonly used to pass filenames, messages, block names and DLL names to user defined subroutines.

Within a user defined subroutine, the MotionSolve utility subroutine GTSTRG is used to access the Reference_String. The ID of the Reference_String itself may be passed as a parameter to the user defined subroutine.

Format

  <Reference_String

    id                  = "1101"

    label               = “Name of the string”

  {    

    string              = "/staff/gates/test/tire_data.xml" >

  |

    usrsub_dll_name     = valid_path_name

    usrsub_param_string = "USER( [[par_1 [, ...][,par_n]] )"

    usrsub_fnc_name     = "custom_fnc_name" >

  |

    script_name         = valid_path_name

    interpreter         = "PYTHON" | "MATLAB"

    usrsub_param_string = "USER( [[par_1 [, ...][,par_n]] )"

    usrsub_fnc_name     = "custom_fnc_name" >

  }

/>

Attributes

id

Element identification number (integer>0).  This number is unique among all Reference_String elements.

label

The name of the Reference_String element.

string

Specifies the character string to be stored.

usrsub_dll_name

Specifies the path and name of the DLL or shared library containing a user subroutine.  MotionSolve uses this information to load the user subroutine in the DLL at run time.

usrsub_param_string

The list of parameters that are passed from the data file to the user defined subroutine, String_Read. This attribute is common to all types of user subroutines and scripts.

usrsub_fnc_name

Specifies an alternative name for the user subroutine String_Read.

script_name

Specifies the path and name of the user written script that contains the routine specified by usrsub_fnc_name.

interpreter

Specifies the interpreted language that the user script is written in. Valid choices are MATLAB or PYTHON.

Comments

Reference_Strings may be used in any user defined subroutine.

Example

The example below demonstrates how a Reference_String can be used to define a filename that can be passed to a VARSUB.  Notice how the ID of the Reference_String is passed as a parameter to the user defined VARSUB.  This generalizes the implementation of the VARSUB.

<Reference_String

    id                  = "1101"

    Label               = “Name of string”

    string              = "/staff/gates/test/tire_data.xml" >

/>

    id                  = "1101"

    Label               = “Name of string”

  {    

    string              = "/staff/gates/test/tire_data.xml" >

  |

    usrsub_dll_name     = valid_path_name

    usrsub_param_string = "USER( [[par_1 [, ...][,par_n]] )"

    usrsub_fnc_name     = "custom_fnc_name" >

  |

    script_name         = valid_path_name

    interpreter         = "PYTHON" | "MATLAB"

    usrsub_param_string = "USER( [[par_1 [, ...][,par_n]] )"

    usrsub_fnc_name     = "custom_fnc_name" >

  }

/>

hmtoggle_plus1greyPython Format

Model Element

Description

STRING defines a user defined text string in MotionSolve.  The string may be of any length.  It must contain only printable ASCII characters. STRING is primarily used within user defined subroutines.  They are commonly used to pass file names, messages, block names, and DLL names to user defined subroutines.

Within a user defined subroutine, the MotionSolve utility subroutine GTSTRG is used to access the STRING.  The ID of the STRING itself may be passed as a parameter to the user defined subroutine.

Declaration

def STRING(id, LABEL="", STRING="", FUNCTION="", ROUTINE="", SCRIPT=""):

Attributes

id

Element identification number (integer>0).  This number is unique among all STRING elements.

LABEL

The name of the STRING element.

STRING

Specifies the character string to be stored.

FUNCTION

Specifies the list of parameters that are passed from the data file to the user defined subroutine, STRING_READ.  This attribute is common to all types of user subroutines and scripts.

ROUTINE

Specifies an alternative name for the user subroutine STRING_READ.

SCRIPT

Specifies the path and name of the user written script that contains the routine.

Comments

See Reference_String

Example

The example below shows how a string may be defined.

STRING(1101,LABEL="Name of String",STRING="/staff/gates/test/tire_data.xml")

See Also:

GTSTRG

Model Statements

Command Statements

Functions

Notation and Syntax

The following MDL Model statements:

*SetSolverString()

*SetString()

*SolverString()