Additionally, all UDOs within a class may have their own methods to allow them
to display, be selected, and
obtain real-time notification during update and
delete events. The methods are registered as callback functions
which occur at key events in an NX
session.
Warning:
It is important to ensure that the required libraries (containing the UDO’s
classes and methods) are present in the environment before opening a part that
contains a UDO. NX will not issue any warning or notification about such
missing libraries. Classes and methods can be
automatically loaded into NX during system initialization.
Due to an enhancement to User Defined Objects (UDOs) in NX 5, all part files that contain UDOs that were created before NX 5 need to be opened and saved in version NX 5, or later.
The refile_part utility can be used to upgrade parts in
batch mode. This avoids errors that may occur when partial loading is used to
open an assembly with components containing UDOs created in earlier versions of
NX.
Sample Code
The files for two sample programs can be found in the ugopen directory.
The first sample is an internal Open C API program that creates an
Occurrenceable UDO. The UDO is displayed as a circle centered on the face
of a block.
See Occurrenceable UDO Sample for detailed
instructions on how to compile, link and run this sample program.
The second sample is an internal Open C API program that associates notes with
drawing views.
The files for the example code are:
ufx_udo.h
ufx_udo_methods.c
ufx_udo_application.c
add_assoc_notes.men
assoc_notes.men
UDO Name
UDOs belong to a class and have a class name assigned to them during creation
of the class. There is also a “user friendly” name that can display which
can be different from the actual class name. The class name should not
match the name of any NX object. A class name should be specified as
unique to a particular application so that there is no collision of class names
from other applications.
The former Generic Entity (Object) is automatically upgraded to a UDO during
part conversion. Its UDO class name matches the sprintf string:
“Generic Entity – Subtype %d”
where the integer corresponds to the subtype for the existing geometric
entity. Therefore the class name for an existing generic entity with a
subtype of 15 would be:
“Generic
Entity – Subtype 15”
You create the class and specify the name with
UF_UDOBJ_create_class. However, once a class is created, you can
only access the class name through the query functions:
UF_UDOBJ_ask_udo_data
and
UF_UDOBJ_ask_class_data
UDO Status
An integer status value (1-7) is set for each UDO by NX in the absence of user
defined methods. You can obtain the status with the query function
UF_UDOBJ_ask_udo_data and the value can be reset to zero with
UF_UDOBJ_clear_udo_status. The description for each status value
is given in the following table.
Status Value |
UDO is out of date |
Due to Addition or Deletion of Links to the UDO |
Due to Update being performed on Associated Objects in the Absence of a UDO Method |
Due to Deletion of Associated Objects in the Absence of a UDO Method |
0 |
No |
|
|
|
1 |
Yes |
Yes |
|
|
2 |
Yes |
|
Yes |
|
3 |
Yes |
Yes |
Yes |
|
4 |
Yes |
|
|
Yes |
5 |
Yes |
Yes |
|
Yes |
6 |
Yes |
|
Yes |
Yes |
7 |
Yes |
Yes |
Yes |
Yes |
If: |
UDO is Deleted |
Associated Object is Deleted |
UDO is Updated |
Associated Object is Updated |
||
What happens to: |
Link |
Associated Object |
Link |
UDO |
Associated Object |
UDO |
Link type 1 |
Removed |
Nothing |
Removed |
Deleted |
Nothing* |
Updated |
Link type 2 |
Removed |
Deleted |
Nothing |
Nothing |
Nothing* |
Nothing |
Link type 3 |
Removed |
Nothing |
Removed |
Updated |
Nothing* |
Updated |
Link type 4 |
Removed |
Nothing |
Removed |
Nothing |
Nothing* |
Nothing |
Owning Link |
Removed |
Nothing (if AssocObj is a solid body) / Deleted (otherwise) |
NA-The AssocObj cannot be deleted directly |
Nothing* |
Nothing |
Owned Object Selection Allowed for: |
Selection of Point-3 |
Selection of Point-3/ Up One Level |
Selection of Point-3/ Up Two Levels |
Selection of Point-3/ Up Three Levels |
UDO-1 UDO-2 UDO-3 |
Point-3 |
Point-3, UDO-3 |
Point-3, UDO-3, Point-2, UDO-2 |
Point-3, UDO-3, Point-2, UDO-2, Point-1, UDO-1 |
UDO-1 UDO-2 |
Point-3, UDO-3 |
Point-3, UDO-3, Point-2, UDO-2 |
Point-3, UDO-3, Point-2, UDO-2, Point-1, UDO-1 |
NA |
UDO-1 UDO-3 |
Point-3 |
Point-3, UDO-3, Point-2, UDO-2 |
Point-3, UDO-3, Point-2, UDO-2, Point-1, UDO-1 |
NA |
UDO-1 |
Point-3, UDO-3, Point-2, UDO-2 |
Point-3, UDO-3, Point-2, UDO-2, Point-1, UDO-1 |
NA |
NA |
UDO-2 UDO-3 |
Point-3 |
Point-3, UDO-3 |
Point-3, UDO-3, Point-2, UDO-2, Point-1, UDO-1 |
NA |
UDO-2 |
Point-3, UDO-3 |
Point-3, UDO-3, Point-2, UDO-2, Point-1, UDO-1 |
NA |
NA |
UDO-3 |
Point-3 |
Point-3, UDO-3, Point-2, UDO-2, Point-1, UDO-1 |
NA |
NA |
|
Point-3, UDO-3, Point-2, UDO-2, Point-1, UDO-1 |
NA |
NA |
NA |