NX Open Programmer's Guide > Interoperation between the Common API and Open C > Wrappers
Wrappers
The Open C API contains thousands of functions built up over many years. The Common API ensures access to this coverage by generating .NET, Java, and Python wrappers for Open C functions.
Notes:
- Some Open C functions have no .NET/Java/Python wrappers — see "Non-NX Open functions" (Non-wrapped NX Open C functions topic).
- Open C callback functions are not fully supported by the .NET
UFWrapper. UF_freeandUF_free_string_arrayonly apply to C/C++ — not needed in wrapped languages (garbage collection handles it).
Open C modules map to classes in the Common API; functions within a module map to methods on the corresponding class (see Naming Conventions topic). Common API represents NX objects as classic OO objects; Open C represents them as tags — the wrapper layer bridges the two models.
Key concepts
Namespace/module structure
- .NET: wrapped classes live in
NXOpen.UFassembly (NXOpen.UF.dll), namespaceNXOpen.UF. - Java:
NXOpenUF.jar, packagenxopen.uf. - Python:
NXOpen_UF.pvdextension module,NXOpen.UFmodule.
UFSession — entry point to access wrapped classes. Get a UFSession
instance first; wrapper classes (one per Open C module) are exposed as methods
on UFSession. E.g. .curve() returns a UFCurve instance.
TaggedObjectManager / NXObjectManager — convert a raw Open C tag back into an NX Open tagged object:
- Java:
TaggedObjectManagerinterface,Getmethod. - Python:
TaggedObjectManagerclass,GetTaggedObjectmethod. - .NET:
NXObjectManager,Getmethod.
Teamcenter Integration part name format — when calling a UFWrapper method
for an Open C subroutine while in Teamcenter Integration, part names must use
the internal TC Integration part-name format, e.g. UFWave.CopyComponentAs
(wrapper for UF_WAVE_copy_component) requires both source and new part names
in that encoded format or the call fails. Encode/decode via
UFUgmgr.EncodePartFilename (wraps UF_UGMGR_encode_part_filename) and
UF_UGMGR_decode_part_filename (wraps UF_UGMGR_decode_part_file_name).
Tag property — every NX Open tagged object exposes a Tag property
(.NET/Python) or tag method (Java/C++) returning the underlying tag for use
with wrapped methods. In C++ there are no wrapped methods, but Tag still
retrieves the tag for use in raw UF functions.
Memory management — no need to call UF_free/UF_free_string_array
equivalents; the language binding's garbage collector reclaims memory
(e.g. char* results are copied into the binding's memory before the C buffer
would need freeing).
Allocating UF-wrapped structures in .NET — must explicitly allocate the
struct rather than use an NX Open-style constructor (e.g. Point3D). Example
(VB.NET):
Dim num_points As Integer = 5
For i As Integer = 0 To num_points - 1
point_data(i) = New UFCurve.PtSlopeCrvatr
point_data(i).point = New Double(3) {}
point_data(i).point(0) = points(3 * i)
point_data(i).point(1) = points(3 * i + 1)
point_data(i).point(2) = points(3 * i + 2)
Next
Language-specific examples — see the InteropNXOpenWithUFWrap sample,
installed at %UGII_BASE_DIR%\ugopen\SampleNXOpenApplications.
Related Topics
- Open C functions used in NX Open methods
- Non-wrapped NX Open C functions
Source: https://docs.sw.siemens.com/en-US/doc/209349590/PL20220512394070742.nxopen_prog_guide/wrappers · retrieved Tue Jul 07 2026 00:00:00 GMT+0000 (Coordinated Universal Time)