NXKnowledge

NX Open Programmer's Guide > Interoperation between the Common API and Open C > UF functions additional descriptions

UF functions additional descriptions

Supplemental clarifications for specific UF functions that need extra explanation beyond their reference-guide entry.

UF_WEIGHT_properties_s

UF_WEIGHT_estab_comp_props1 returns the inertia tensor of the solid body from Parasolid. The -products_of_inertia data members are the inertia tensor (-lxy, -lxz, -lyz), which carry a reversed sign relative to the true products of inertia (lxy, lxz, lyz).

UF function pointers (memory-ownership changes)

UF_KF_ask_string() — in prior releases the returned pointer did not need freeing. It now must be freed to avoid a memory leak. New prototype:

extern UFUNEXPORT int UF_KF_ask_string
(
   UF_KF_value_p_t  value,  /* <I> Knowledge Fusion value */
   char            **string /* <OF> Value. Must be freed. */
);

UF_KF_ask_name_chain_of_instance() — same change: the returned pointer now must be freed (UF_free). New prototype:

extern UFUNEXPORT int UF_KF_ask_name_chain_of_instance
(
   UF_KF_instance_p_t   instance,   /* <I> Knowledge Fusion instance */
   char                **name_chain /* <OF> Name chain of instance. Free with UF_free. */
);

Takeaway: if upgrading code that calls UF_KF_ask_string or UF_KF_ask_name_chain_of_instance, add a UF_free call on the output pointer — older code that didn't free it will now leak memory.

Related Topics

  • Interoperation between Open C and common API
  • Wrappers
  • UF and JA APIs
  • Mapping Open C to NX Open Common API

Source: https://docs.sw.siemens.com/en-US/doc/209349590/PL20220512394070742.nxopen_prog_guide/xid1685242 · retrieved Tue Jul 07 2026 00:00:00 GMT+0000 (Coordinated Universal Time)