BuildDate
BuildDate
BuildDate
SignatureBuildDate() : Date
BuildDeferredMessageNLS
Function used to build a NLS message (a message in a given language) by finding it in a CATXXX.CATNls file depending on the NLS client on a target machine. Its role is to store the information to build a message (could be error, warning or info) from catalog, key and inputs arguments.
Arguments
Name | Input / Output | Required? | Type | Comment |
MessageCatalog | In | Yes | String | CATNls file name or .properties file name. File name without extension. |
MessageKey | In | Yes | String | Key name in the .CATNls or in the .properties file. |
argument | In | Optional | Literal | Variable arguments number. |
The output is a structure composed of Catalog, Key and List of arguments, that will be affected to Parameters. Note:
The BuildMessageNLS on the client is replaced by a BuildDeferredMessageNLS on the server. .CATNls files are to be used on the client. The format must be as follows: // Name of the catalog: Catalog1.CATNls
Message1.Request = "";
Message1.Diagnostic = "No description for (/p1)";
Message1.Advice = "You should add a description for (/p1)";
.properties files are to be used on the server. The format must be as follows:# Name of the catalog: Catalog1.properties
Message1 = "No description for ({0})";
ExampleParameters.NLSMessage = BuildDeferredMessageNLS("Catalog1", "Message1", "MyObject")
BuildMessageNLS
Enables you to send messages or ask questions through the Message and Question functions in the language of your choice. The BuildMessageNLS function can build a NLS message (a message in a given language) by finding it in a CATXXX.CATNls file.
Arguments
Name | Input / Output | Required? | Type | Comment |
MessageCatalog | In | Yes | String | |
MessageKey | In | Yes | String | |
argument | In | No | Literal | |
ExampleThe KwrCATCatalog.CATNls file contains the following text: Zero = "Zero";
One = "One /P1";
Two = "Two /P1 /P2"; Zero, One and Two are the messages. The first message has no arguments, the second has 1 argument, the third, 2 arguments. To display those messages in a Engineering Rules Capture rule for example, enter the following rule body: Message (BuildMessageNLS("KwrCATCatalog","Zero")) Message (BuildMessageNLS("KwrCATCatalog","One",x)) Where x is a parameter.Message (BuildMessageNLS("KwrCATCatalog","Two",y,z)) Where y, and z are parameters.
DateFormat
Enables you to retrieve a date as a string.
Arguments
Name | Input / Output | Required? | Type | Comment |
format | In | Yes | String | |
date | In | No | Date | |
GetEnvVariableValue
Enables you to read the content of an environment variable.
Arguments
Name | Input / Output | Required? | Type | Comment |
VarName | In | Yes | String | Name of the variable. It returns the name of the variable. |
GetPLMOwner
Enables you to retrieve the PLM Owner of any kind of object.
Signature
- If the object is inside a representation, it retrieves the representation
that contains it.
- If the object is a PLMEntity, it returns itself.
- If the object is not persistent, it will return a NULL value.
- The result of the GetOwner can be put in any kind of variable. But if you do
not use a variable of the right type, it will be equal to NULL.
There are several ways to use GetPLMOwner but the main goal is to propagate a
value from an object in a representation, into an attribute of the
representation. Note:
Note that no particular license is required in case you run
this
function.
GetPLMOwner(Object : ObjectType) : UndefinedType
Arguments
Name | Input / Output | Required? | Type | Comment |
Object | In | Yes | ObjectType | |
Examplelet x(VPMRepReference)
x = GetPLMOwner (Point) /* Point is the point in the model */
x.V_Description = "Hello"
ReplaceAll
Lets you replace occurrences of a string by another one in a given string.
Example- Create a knowledge action.
- Enter the following script:
Let stringToModify(String)
Let stringModified(String)
Let replacingString(String)
Let replacedString(Strnig)
stringToModify = "test1234testest1234test"
replacedString = "test"
replacingString = "thisStringHasBeenModified"
stringModified = ReplaceAll(stringToModify,replacedString,replacingString)
Message(stringModified)
- Execute the action and check that it displays:
"thisStringHasBeenModified1234thisStringHasBeenModifiedest1234thisStringHasBeenModified" .
ReplaceSubText
Enables you to replace the first occurrence of string with another string and returns the result.
Arguments
Name | Input / Output | Required? | Type | Comment |
v1 | In | Yes | String | |
v2 | In | Yes | String | Can be specified either with their parameters names or with the string itself between quotes. |
v2 | In | Yes | String | Can be specified either with their parameters names or with the string itself between quotes. |
ToLower
Enables you to change all upper-case letters of a string to lower-case.
Arguments
Name | Input / Output | Required? | Type | Comment |
v1 | In | Yes | String | Name of the string type parameter. |
ToString
Enables you to convert an integer into a string.
Arguments
Name | Input / Output | Required? | Type | Comment |
| In | Yes | Real | |
Examplelet s = ""
s = ToString(3.4)
let s = ""
s = ToString(3.4)
ToUpper
Enables you to change all lower-case letters of a string to upper-case.
Arguments
Name | Input / Output | Required? | Type | Comment |
v1 | In | Yes | String | Name of the string type. |
String.Search()
Searches for the first occurrence of a sub string in a String type parameter. It returns the index (o or 1) of the start of the substring. It returns -1 if the substring specified is not found.
Arguments
Name | Input / Output | Required? | Type | Comment |
a1 | In | Yes | String | Name of the SubString parameter |
| In | No | String | |
index | In | No | Integer | Corresponds to the index of the character to start the search. The index starts at 0. If you're not using this argument, the default value is 0. |
Forward | In | No | Boolean | Indicates if we want to search the string from the beginning of the string (forward equal to true) or from the end (forward equal to false). Note that when we are searching backward, the index value corresponds to the rank of the character in backward order. If you're not using this argument, it will search in forward mode. |
Example
String.Extract()
Returns the sub string starting at a given position with a specified length.
Examplelet Responsible = "Cilas Evans Evans"
Message ("#",Responsible.Extract(2,2))
/* "la" appears. */
String.Length()
Applies to a string type parameter. Returns the string length.
Arguments
Name | Input / Output | Required? | Type | Comment |
a1 | In | Yes | String | |
Examplelet Responsible = "Cilas Evans Evans"
let i=0
i = Responsible -> Length()
String.ToReal()
Converts a string into a real.
Arguments
Name | Input / Output | Required? | Type | Comment |
a1 | In | Yes | String | |
Examplelet s = "2.3"
let r=0.0
r = s -> ToReal()
|