CheckLicense
Enables you to verify if a given license was acquired by the current user.
Arguments
Name | Input / Output | Required? | Type | Comment |
License | In | Yes | String | Name of the license |
LaunchError | In | Yes | Boolean | True if the user is granted the license or False if not, and Integer 0 (if the user is granted the license) or 1 (if not). |
- The method verifies that the current user is granted a Native App
license.
- If the user does not own the license, a Knowledge report is launched.
- This function can prove particularly useful when
working with Know-how Apps Components. It can help a Know-how Apps Components designer stop the process if it
requires an unavailable license.
ExampleIf (CheckLicense(“license1”,TRUE) == 0)
{
...
}
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 2- 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 see as many messages
as loop iterations.
Message (BuildMessageNLS(KwrCATCatalog, Zero))
Notify
Enables you to display a yellow tooltip on the upper 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 the 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.
SignaturePopupMessage(message : String [, argument : Literal, ..])
Arguments
Name | Input/Output | Required? | Type | Comment |
message | In | Yes | String | --
|
argument | In | No | Literal | --
|
Examplelet i = 1
for i while i < 10
PopupMessage("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 an 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, define
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). See also Trace on the server side.
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 verify 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()
)
|