File Name Formats


 
When running Open C API programs in NX Manager mode, you must specify the file name of a part in a different format from when you are running an Open C API program in standard NX mode.
 
Different file name formats require different information. At a minimum, you always need a part-number and part-revision. The possible strings that you may use are:
 
NX Manager supports the following type of part file formats:
 
The encoded file format is the format which is used internally within NX Manager and by itself may seem a little cryptic. Decode, CLI and display file formats allow you to manipulate or display part files in a simple and user friendly way.
 
Encoded format (internal format)
 
NX Manager recognizes part file names in a special encoded string format, rather than the "<part number>.prt" form in standard NX. It is therefore necessary to encode the file name of a part into this special format before attempting to use it in any Open C API running in NX Manager mode that takes a part file name as input.
 
Encoded (or internal) file format is used as either input or output in the following routines:
 
An example of the encoded (or internal) file format may look like the following:
 
Master Part %UGMGR=V3.2 PN=my_part_number PRN=A AT="UG master part file"
 
Non-Master Part %UGMGR=V3.2 PN=my_part_number PRN=A AN=my_part_name AT="UG part file"
 
NOTE:
NX reserves the right to change the internal structure of the encoded format at any time. For this reason, the encoded syntax is not explained here. An Open C API programmer only needs to know how to interface with NX Manager's encoded file format using the supplied routines.
 
Decoded format
 
The decoded format is simply a part file name broken down into its constituent elements (part number, part revision, part file type, and part file name). To decode an encoded part file, you would use UF_UGMGR_decode_part_filename.
 
Command line input (CLI) format
 
Command line input file format allows you to type the part file name using a simple file format. Each CLI name is prefixed by "@DB". The first character following the "@DB" sequence is called the separator. The default separator is "/". The separator character can not be a character which is currently used by either the part name, part revision, part file type or part file name.
 
CLI file format is used as either input or output in the following routines:
 
The CLI syntax is:
 
Master Part: @DB/part-number/part-revision
Non-Master Part: @DB/part-number/part-revision/type/name
 
Where "type" can be manifestation, or specification.
 
An example of the CLI format may look like the following:
 
Master Part: @DB/my_part_number/A
 
Non-Master Part: @DB/my_part_number/A/manifestation/dwg1
 
Display name format
 
Display name format allows you to display parts in the same fashion as an interactive NX Manager session would. The routine to display parts in the display name format is UF_PART_name_for_display. To get the part_tag of a file in the displayed name format, you can use UF_PART_ask_tag_of_disp_name. The syntax for master and nonmaster part files are:
 
Master Part: part-number/revision
Non-Master Part: part-number/revision (type: name)
 
Where "type" can be manifestation, or specification.
 
For input, UF_PART_name_for_display accepts either the CLI or encoded format of a part file.
 
An example of the display name format may look like the following:
 
Master Part: my_part_number/A
 
Non-Master Part: my_part_number/A (manifestation: dwg1)
 
If you need to decode a display name you can use UF_PART_ask_tag_of_disp_name to get the part's tag. You can then get the part name with the part tag using UF_PART_ask_part_name.
 
Encoding and Decoding Part File Names
 
You encode the part file name into the encoded string format using the UF_UGMGR_encode_part_filename function, that requires the following information:
 
Once you have an encoded string of the part file name, you may decode it at a later stage to obtain the constituent elements (part number, part revision, part file type, and part file name) using the Open C API UF_UGMGR_decode_part_filename.
 
For details see Open C APIs  UF_UGMGR_encode_part_filename and  UF_UGMGR_decode_part_filename
 
NOTE: You can manipulate standard ("native") NX part files using the UF_PART_open, UF_PART_save, and UF_PART_close functions in your Open C API program. However, we recommend the following precautions before doing this: