Reuse Knowledge Fusion functions in NX expressions

Overview

How To

Options


Use the following steps to expose custom Knowledge Fusion functions to the Expressions subsystem:

Please note that users should be careful in exposing custom functions because the expressions subsystem supports only a subset of the data types supported by knowledge fusion.

Note:

The filename of the .dfa file that contains the custom functions appears as the name for the category in which the exposed functions appear in the function builder.

Following is an example of reusing functions in expressions:

#! NX/KF 5.0
DefClass: func_test (ug_base_part);
##############################################################################
Defun: custom_find_midPoint(
#+
DesignLogic=Yes
----------------------------------------------------------------------------
Description:
#.
Returns the mid point of 2 given points
.#
Input:
(Point) $p1 -
First Point
(Point) $p2 -
Second Point
----------------------------------------------------------------------------
#-
Point $p1, #.Specify First point#
Point $p2 #.Specify second point#
)
@{
$mid_point<<Point( (LocalX($p1)+LocalX($p2))/2, (LocalY($p1)+LocalY($p2))/2,(LocalZ($p1)+LocalZ($p2))/2 );
LocalZ($p1)+LocalZ($p2))/2 );
#+
---------------------------------------------------------------------------—
Returns:
(Any) - #.The mid point#
See Also:
---------------------------------------------------------------------------—
#-