4.1.20. Catia Node

Your Ad Here

The Catia Node is used to wrap a Catia V5 document, transferring data from and to it, and executing macro files on it. A Catia document is either a CATPart, a CATProduct or a CATAnalysis.

Warning

In order to use the node during the analysis, to open the document in a new Catia session and to use the introspection, you need to have installed Catia V5 on your computer and the PATH environmental variable must be properly setted. Usually the PATH variable must contain the path to the cnext.exe executable on Windows platforms and the path to the catstart script on Unix platforms.

You can also configure the correct Catia COM options in the modeFRONTIER preferences, see Section B.4.3, "Catia" for further details.

Node Configuration

The Catia Node Properties Dialog

Figure 4.45. The Catia Node Properties Dialog

Configuring a Catia node requires setting several parameters:

If you have specified a valid CATPart, CATProduct or CATAnalysis document, you could take advantage of the following features:

At run-time, several different operations are carried out behind the scenes:

  1. modeFRONTIER creates an appropriate CATScript to drive the Catia execution.

  2. A new Catia process is launched, the specified document is loaded and the CATScript is started. The environment in which Catia is launched contains the following variables:

    • PART_NAME: the full path name for the CATPart, CATProduct or CATAnalysis being used

    • APPL_PWD: the absolute path of the working directory for the Catia process

    • DESIGN_ID: the ID for the design being evaluated

    • PROJECT_NAME: The name of the modeFRONTIER project within which the script is being run

    • APPL_STDOUT: The name for the file where the standard output will be redirected

    • APPL_STDERR: The name for the file where the standard error will be redirected

    • APPL_PRIORITY: The priority with which the script will be executed (not available in COM mode)

    • ESTECO_USER: The username of the user that requested the execution. This is not necessarily the user that owns the script, because, for example, the script could be run by the Launcher on behalf of a remote user.

  3. The CATScript assign the input variable values to the parameter indicated in the Data Input Connector panel.

  4. All the parts involved are updated.

  5. The script file is run (if any has been specified).

  6. Output (or buffer) variables values are extracted from the parameters indicated in the Data Output Connector panel.

  7. If the Store Document in Working Dir flag is set, the document is stored in the working directory for the node.

  8. The document is exported in all the specified formats.

  9. Catia process ends its execution.

If everything works correctly, the exit value for the node is zero. Otherwise, one of the following values is returned:

910A failure occurred while retrieving the output data
912The job has been killed before it could terminate
920The job was set-up incorrectly, and it was not possible to start it
921The data extracted from the workspace could not be retrieved
6015It was not possible to extract the value of a design variable

Compatibility Notes

The node has been fully tested with Catia V5R09 on HP-UX platform and with Catia V5R14 on Windows XP.

There are some known incompatibility issues:

Input Connections

The Catia node input can be connected to one or more nodes. The connectable nodes are different for each connector. The process input connector can only be connected to the process output connector of nodes that belong to one of the following types:

For each node belonging to one of the first seven node types (i.e., for each application node) that you connect, you must also indicate for which values of the application exit value you want the Process Flow to be routed through this node (see Section 4.2.7, "Conditional Expression Legal Syntax"). Only when the application exit value matches the condition this node will be processed.

The data input connector can be connected only to nodes that belong to one of the following types:

For each node belonging to one of the last four node types (i.e., for each node representing a design variable) that you connect, you must also indicate which parameter you want to set with the value. This requires specifying the parameter name.

Output Connections

The Catia node output can be connected to one or more nodes, different for each connector. The process output connector can only be connected to the process input connector of nodes that belong to one of the following types:

For each connected node, you also need to specify for which values of the exit value you want the Process Flow to be routed through the connected node (see Section 4.2.7, "Conditional Expression Legal Syntax"). Only those output branches for which the exit value matches the corresponding condition will be transversed. If no condition matches the exit value, it is assumed that the design is failed, and the Work Flow execution is interrupted. Note: all conditions must be mutually exclusive (i.e., there can be no exit value for which two or more conditions hold true).

The data output connector can be connected only to nodes that belong to one of the following types:

For each output and buffer variable connected, you must also indicate from which parameter (usually a measure) you want to read the value. This requires specifying the parameter name.

Logic Log Messages

The following error messages can be associated with a Catia node:

239MISSING CATIA DOCUMENTNo Catia CATPart, CATProduct neither CATAnalysis has been selected, or the Catia document indicated does not exist
231CATIA NODE NOT REACHEABLEThe Process Flow cannot be routed through the Catia node because an appropriate input connection is missing
232NO EXIT PATH FOR CATIA NODEThe Process Flow cannot be routed past the Catia node because an appropriate output connection is missing
230MISSING ADDRESS FOR CATIA PARAMETERA legal parameter name has not been associated with one or more design variables connected to the Catia node
233NO INPUT FILE OR VARIABLE FOR CATIA NODENo design variable or file is supplied to the Catia node
202INVALID EXIT CONDITION(S)The conditions for the output nodes that support the Process Flow routing are not mutually exclusive

Sample Script File

Sub CATMain()
        part = CATIA.SystemService.Environ("PART_NAME")
        pwd = CATIA.SystemService.Environ("APPL_PWD")
        id = CATIA.SystemService.Environ("DESIGN_ID")
        project = CATIA.SystemService.Environ("PROJECT_NAME")
        user = CATIA.SystemService.Environ("ESTECO_USER")
		
        'in case of COM mode you should use the code commented below instead
        'part = Environ(PART_NAME)
        'pwd = Environ(APPL_PWD)
        'id = Environ(DESIGN_ID)
        'project = Environ(PROJECT_NAME)
        'user = Environ(ESTECO_USER)

        rseult = ""
        result = result & "PART_NAME=" & part & vbCRLF
        result = result & "APPL_PWD=" & pwd & vbCRLF
        result = result & "DESIGN_ID=" & id & vbCRLF
        result = result & "PROJECT_NAME=" & project & vbCRLF
        result = result & "ESTECO_USER=" & user & vbCRLF
     
        CATIA.SystemService.Print(result)
End Sub
The above macro will produce the following output:
Starting CNEXT -batch /work/scratch/bimbo/depot/benchmark_bimbo.CATPart -macro ...
Remote Connection

-------------- CATIA --------

PART_NAME=/work/scratch/bimbo/depot/benchmark_bimbo.CATPart
APPL_PWD=/home/paolov/catia/a_000005/proc/DES_00000-00499/DES_00000/Catia53_00000
DESIGN_ID=0
PROJECT_NAME=a
ESTECO_USER=mauro

-----------------------------

Measure values

In order to extract the correct measure values you need to configure Catia for the automatic update of the measures in parts and products. To do so consult your Catia documentation, however the following steps could be sufficient:

  1. Start Catia

  2. Select Tools->Options

  3. Select the node Options+General+Parameter and Measure

  4. Select the tab Measure Tools

  5. Enable the checkboxes Automatic update in part and Automatic update in product


Return to modeFRONTIER Index


Your Ad Here
??