API for Providing Additional Information from DesignSync

You can define TCL functions for DesignSync to export addtional information from DesignSync modules into ENOVIA product revisions. This is done by modifying creating custom TCL code and then adjusting the TCLInit fle to read the custom code.

Modify the functions on the DesignSync server as custom TCL code in packages in the custom/site/share/tcl areas in the dscustom TCL package. The function names are fixed and must be exactly those shown.

This page discusses:

Start-up Function

This function is called at the start of the operation. The argument is the local module URL. The function return value is ignored. If this function throws an error, that is also ignored and recorded in the server error log. This function must have this exact name:

dscustom::importModuleVersionsStart <module url> => {}

For example:

package provide dscustom 1.0
proc dscustom::importModuleVersionsStart {moduleUrl} {
    <perform some setup work>
    return
}

You would call this function from this system:

dscustom::importModuleVersionsStart sync:///Modules/cat/MyMod

Per-version Function

This function runs for each module version selected to be passed back to ENOVIA. The argument is the local module version URL. The function return value must be a list that is either empty or contains pairs of property names and values. If the functions throws an error, or returns a value in an incorrect format, this is ignored (treated as a return value of an empty list) and is recorded in the server error log.

This function must have this exact name:

 dscustom::importModuleVersionsProcess <module version URL> => {name value …}

For example, this function includes the value of property "p1" for each module version:

package provide dscustom 1.0
proc dscustom::importModuleVersionsProcess {moduleVersionUrl} {
    set propName p1
    set val [url getprop $moduleVersionUrl $propName]
    return [list $propName $val]
}

This function is called multiple times, once for each module version:

set userProps [dscustom::importModuleVersionsProcess {sync:///Modules/cat/MyMod;1.1} ]
…
set userProps [dscustom::importModuleVersionsProcess {sync:///Modules/cat/MyMod;1.2} ]
…

Completion Function

This function runs at the end of the operation to perform any necessary clean-up tasks. The argument is the local module URL. The function return value is ignored. If this function throws an error, that is also ignored and recorded in the server error log.

This function must have this exact name:

dscustom::importModuleVersionsEnd <module url> => {}

For example:

package provide dscustom 1.0
proc dscustom::importModuleVersionsEnd {moduleUrl} {
    <perform some cleanup work>'
    return
}

Making the Custom Code Available to the Server

  1. Copy the custom code to the following directory:
    $SYNC_CUSTOM_DIR/custom/site/share/tcl/SCC_module_export_extension.tcl 
    (using the custom code name example SCC_module_export_extension.tcl)
  2. Edit $SYNC_DIR/share/tcl/tclInit.tcl:

    Search for this line in the file:

    source [locate share/tcl/mxbridge/mxBridge.tcl]
    Add the following line after the mxBridge.tcl call.
    source [locate custom/site/share/tcl/SCC_module_export_extention.tcl]

  3. Restart the server.