Message
Enables you to display a message in an information box. The message
can include one or more parameter values.
Arguments
Name | Input / Output | Required? | Type | Comment |
message | In | Yes | String | String to be displayed in the information
box (must be put in quotes). |
argument | In | No | Literal | When parameter values
are to be displayed within the message, the arguments must be specified
as follows:
- one string in quotes including a #
symbol wherever a parameter value is to be displayed.
- as many [, parameter name] statements as parameter
values declared with a "#" in the message.
|
Note:
Use the "|" symbol to insert a carriage return in a message.
Example 1Message("External radius is: # | Internal Radius is: #", PartBody\Sketch.1\Radius.3\Radius, PartBody\Hole.1\Diameter) Example 2Message (BuildMessageNLS(KwrCATCatalog, Zero)) Note:
Remember that:- This function can be used along with the
BuildMessageNLS function.
- Messages returned by the Message
operator are returned only at the end of rules executions.
The order in which they are returned is identical to the order in
which they were sent.
It is the only way to make sure that messages are not displayed
twice. Two messages are considered as identical if the first evaluator strings are identical.
For example, Message ("", 3mm) and Message ("",4mm) are considered as identical and only the second one appears. When working with loops, if a message appears at each loop iteration, all messages are displayed. So if a message displays the iterator in a loop, for example Message("",i) , you will see as many messages as loop iterations.
Notify
Enables you to display a yellow tooltip on the top right of the screen. To avoid tooltip overlap, the messages are stored within a defined timeframe and displayed altogether when the application idles.
The notifications are stacked until: - The notifications stack reaches 40 elements.
- Notify is called using “|” as first character, which indicates that you want to start a new notification stack.
When the application idles, the different stacks are displayed as tooltips. Each tooltip appears for a certain time which is computed using the size of the message with a maximum of 60 seconds.
Arguments
Name | Input / Output | Required? | Type | Comment |
message | In | Yes | String | |
argument | In | No | Literal | |
PopupMessage
Function identical to Message except that it does not have the optimization that compacts different messages into one and blocks the evaluation until the user clicks OK.
Arguments
Name | Input / Output | Required? | Type | Comment |
severity | In | Yes | String | |
message | In | Yes | String | |
argument | In | No | String | |
Examplelet i = 1
for i while i < 10
Message("i = #", i) When executing the above script, the PopupMessage function displays the 10 popup messages and stops the execution when calling the PopupMessage function. If you use the Message function, you only see "i = 1" which appears at the end of the script execution.
Question
Enables you to display a message in a dialog box, click a button to get a value indicating which button you clicked
(true if Yes was clicked, false if No was clicked).
Arguments
Name | Input / Output | Required? | Type | Comment |
question | In | Yes | String | String to be displayed in the dialog
box (must be put in quotes). |
argument | In | No | Literal | When parameter values
are to be displayed within the message, the arguments must be specified
as follows:
- one string in quotes including a #
symbol wherever a parameter value is to be displayed.
- as many [, parameter name] statements as parameter
values declared with a "#" in the message.
|
Note:
Use the "|" symbol to insert a carriage return in a prompt.
ExampleBoolean2 = Question("SketchRadius is # | Do you want to change this value ?",
PartBody\Sketch.1\Radius.3\Radius )
Report
Enables you to create an error displayed at the end of evaluation in an error report.
Arguments
Name | Input / Output | Required? | Type | Comment |
severity | In | Yes | String | Can be Information, Warning or Error. |
summary | In | Yes | String | String that qualifies the error. It can both contain # characters combined with the variable arguments. |
message | In | Yes | String | String that qualifies the error. It can both contain # characters combined with the variable arguments. |
argument | In | No | Literal | |
Note:
To view an example, import the Sample_extra.3dxml file located in win_b64\startup\Knowledgeware\ PKT Samples\Sample 1 in the installation folder.
TextFormat
Function used to build a message using a format string and its arguments.
Arguments
Name | Input / Output | Required? | Type | Comment |
format | In | Yes | String | |
argument | In | No | Literal | |
ReturnTypeString Note:
The format to be used is identical to the one of the Message function.
Trace
Enables you to write information in a file for debugging
purposes for example.
On the client side, to do so, valuate the
CATKnowledgeTracePath variable (for example, set CATKnowledgeTracePath=E:\Temp\CATKnowledge_UserDefined.txt ).
If the variable is empty, the default name of the trace file is CATKnowledgeTrace_YYYY-MM-DD_HH-MM-SS.txt.
This file is located in the CATTemp directory (For example: C:\Documents
and Settings\user\Local Settings\Application Data\DassaultSystemes\CATTemp\CATKnowledgeTrace_2005-8-8_16-28-20.txt). On the server side, to activate traces, the server must be launched with the trace options: For instance when working with a Tomcat server,set _JAVA_OPTIONS=-DJSystemTraceFile=e:\tmp\traces.txt.In this traces.txt file, the environment variable has to be set : - CKE_CUSTO_TRACES 10 for basic traces like Business rules called,
- CKE_CUSTO_TRACES 30 for advanced traces like objects dump
Traces put with the function Trace() in the script are displayed on the server side, in the application server console. These traces are only use for debug issues.
Arguments
Name | Input / Output | Required? | Type | Comment |
level | In | Yes | Integer | Comprised between 1 and 9 and is used to indent the
traces |
message | In | Yes | String | message used like in Message function. |
argument | In | No | Literal | Must have the same number of # and parameters. If there
are more parameters than #, parameters are added at the end of the
message. If there are more # than parameters, the character # is
not replaced |
- The | symbol lets you insert a carriage return in a prompt.
- # is replaced with the parameter value.
ExampleTrace(1 , "MyMessage...
Param1: #, Param2: #", Integer.1, String.1) The generated .txt file looks like the one below:
Action.1: |
MyMessage... Param1: 1, Param2:
I'm a string |
Action.1: |
MyMessage... Param1: 1, Param2:
I'm a string |
Action.1: |
MyMessage... Param1:
2, Param2: I'm a string |
Action.1: |
MyMessage... Param1:
3, Param2: I'm a string |
Action.1: |
MyMessage... Param1:
3, Param2: I'm a string # <-- Too many # |
Action.1: |
MyMessage... Param1:
3, Param2: I'm a string3 <-- Too many parameters |
Action.1: |
MyMessage... Param1: 4, Param2: I'm a string |
Action.1: |
MyMessage... Param1: 5, Param2: I'm a string |
Action.1: |
MyMessage... Param1: 6, Param2: I'm a string |
Visual Basic Script Macro -> Run
Function used to run a macro with arguments. It is up to you to check that the macro which is run is not
going to cause an infinite loop or result in a system crash.
SignatureVisual Basic Script Macro->Run(valueOrFeature:ObjectType,...): VoidType
Arguments
Name | Input / Output | Required? | Type | Comment |
valueOrFeature | | | | Corresponds to the macro argument. Macros have
arguments that have a particular order. Values assigned to arguments have to be
passed in the same order. |
ReturnTypeString Note:
The format to be used is identical to the one of the Message function.
Exampleif PartBody\Pad.1.HasAttribute(String.1) == true
`VB Scripts.1` .Run(PartBody\Pad.1 .GetAttributeString(String.1),PartBody\Pad.1.Name()
)
AdvisorAction -> Run
Executes an action.
Signature
AdvisorAction->Run(valueOrFeature:ObjectType,...): VoidType
Arguments
Name |
Input / Output |
Required? |
Type |
Comment |
valueOrFeature |
|
|
|
The arguments to pass to the action execution. There must be
the right number of arguments based on the signature of the
action.
|
ReturnType
String
Note:
The format to be used is identical to the one of the Message function.
Example
if PartBody\Pad.1.HasAttribute(String.1) == true
`Action.1` .Run(PartBody\Pad.1 .GetAttributeString(String.1),PartBody\Pad.1.Name()
|