String

Model ElementString defines a user defined text string in MotionSolve.

Class Name

String

Description

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.

Attribute Summary

Name Property Modifiable by command? Designable?
id Int ()   NO
label Str () Yes
string String () Yes

Usage

String (string=String, optional_attributes)

Attributes

string
String
Specifies the character string to be stored.
The attribute string is mandatory.
id
Integer
Specifies the element identification number. This number must be unique among all the String objects in the model.
This attribute is optional. MotionSolve will automatically create an ID when one is not specified.
Range of values: id > 0
label
String
Specifies the name of the String object.
This attribute is optional. When not specified, MotionSolve will create a label for you.

Example

The example below shows how a string may be defined.
XML Syntax Python Syntax
<Reference_String 
   id = "1101"
   label = "Tire file" 
   string = "/Users/tire_data .xml"
/>
filename = "/Users/tire_data .xml" 

str1 = String (string=filename, 
label="Tire file")

Comments

  1. See Properties for an explanation about what properties are, why they are used, and how you can extend these.
  2. Reference_Strings may be used in any user defined subroutine.
  3. Within a user defined subroutine, the utility GTSTRG is used to access a Reference_String. The ID of the Reference_String may be passed as a parameter to the user-defined subroutine.