
Introduction to "ug_edit_part_names"
------------------------------------

This ug_edit_part_names utility provides facilities for changing component part
references inside an assembly part.  It does so without loading the part which
means it is fast and it is UG version independent (from v10 onwards).  It is
possible to change the name of a component that was previously referenced (which
has since been renamed) or the directory where a component can be found can be
modified (if the component has been moved).  It is also possible to change the case
used to reference components which can be useful when moving parts from one
operating system (such as VMS) to a different o/s (such as NT) that handles
case comparisons differently.

As with most powerful tools it is also necessary to use it with care.  For
example if not careful it is possible to create a cyclic assembly structure, or
point two different sub-assemblies at the same component when they previously
referred to different components.  For this reason IT IS STRONGLY RECOMMENDED,
especially when experimenting with this tool, THAT YOU TAKE COPIES OF YOUR PARTS
BEFORE EDITING THEM.  Having made the edits test the changes by loading the
assemblies in Unigraphics to make sure they will retrieve as expected before
discarding the original parts.

In order to use this tool successfully it is necessary to have some
understanding of the structure of a UG assembly.  Taking a simple example
assembly assy,prt -> sub-assy.prt -> comp.prt it is necessary to understand
that the definitive reference to a component is made by its immediate parent
even though higher level parents will have references to children lower than
their immediate children. The general rule for where to change a reference is to
change all parts that have a reference to the component being changed since
this will mean the UG needs to perform no update when the assembly is next
loaded.  However from v12 onwards in most cases it would be possible to just
rename the references from the immediate parents of the component and UG's
update will cope correctly.

This utility should be used in conjunction with ugpc to determine what assembly
structures you have in the parts you are changing.  However it should be
pointed out that unless ugpc is used with the "-a" option it will not be
guaranteed to print the directories as-saved.

This utility comes with help on the options available by typing 
"ug_edit_part_names -help".  These options are described here:

 <input part name>
    This argument is required.

 -list
    This option outputs the non-Id references contained in the part that can be
    changed using this program.  This option takes precedence over the -id_list option.

 -id_list
    This option outputs the Id references contained in the part that can be
    changed using this program.

 -o <output part name>
    If making edits to the input part this argument is required.  The
    output part can be the same as the input part in which case the part
    will be edited in place.

 -change_name <current component part name> <new component part name>
    This option changes the name of a referenced component from the
    current name to the new name.

 -change_dir <current directory> <new directory>
    This option replaces all references to the current directory to be
    the new directory.

 -change_id <current id type> <current id value> <new id value>
    This option changes the value of an Id reference from the
    current value to the new value.

 -change_comp_dir <current component part name> <new component directory>
    This option replaces the directory used by the current component part
    to be the new directory.

 -lower_name
 -upper_name
    This option forces all part names to be lower or upper case.

 -lower_dir
    This option forces all directories to be lower case.

 -remove_dirs
    This option removes all directory information.

 -intro
    This option describes this utility.

 -examples
    This option describes some example calls.

 -help
    This help option.

ug_edit_part_names also comes with some examples of how it is used by typing
"ug_edit_part_names -examples".  These examples are given here:

The following examples are based around an example assembly that has the
following structure:

    /parts/assy.prt
        /standard_parts/screw.prt
        /parts/sub_assy.prt
            /parts/comp.prt
            /standard_parts/BOLT.prt

This usage would yield the following output:
  "ug_edit_part_names assy.prt -list"

    assy.prt (/parts)
    screw.prt (/standard_parts)
    sub_assy.prt (/parts)
    comp.prt (/parts)
    BOLT.prt (/standard_parts)

This usage would yield the following assembly:
  "ug_edit_part_names sub_assy.prt -o new_sub_assy.prt -change_name comp.prt new_comp.prt"
  "ug_edit_part_names assy.prt -o new_assy.prt -change_name sub_assy.prt new_sub_assy.prt"

    /parts/new_assy.prt
        /standard_parts/screw.prt
        /parts/new_sub_assy.prt
            /parts/new_comp.prt
            /standard_parts/BOLT.prt

This usage would yield the following assembly:
  "ug_edit_part_names new_sub_assy.prt -o new_sub_assy.prt -change_comp_dir new_comp.prt /in_progress"

    /parts/new_assy.prt
        /standard_parts/screw.prt
        /parts/new_sub_assy.prt
            /in_progress/new_comp.prt
            /standard_parts/BOLT.prt

This usage would yield the following assembly:
  "ug_edit_part_names new_assy.prt -o new_assy.prt -change_dir /standard_parts /new_standard_parts"
  "ug_edit_part_names new_sub_assy.prt -o new_sub_assy.prt -change_dir /standard_parts /new_standard_parts"

    /parts/new_assy.prt
        /new_standard_parts/screw.prt
        /parts/new_sub_assy.prt
            /in_progress/new_comp.prt
            /new_standard_parts/BOLT.prt

This usage would yield the following assembly:
  "ug_edit_part_names new_sub_assy.prt -o new_sub_assy.prt -lower_name"

    /parts/new_assy.prt
        /new_standard_parts/screw.prt
        /parts/new_sub_assy.prt
            /in_progress/new_comp.prt
            /new_standard_parts/bolt.prt
