Command Line Publishing with ugbatch
From a shell command line, NX CAD data can be converted to Creo View format using the ugbatch script. This chapter outlines how to use the ugbatch command, including the most commonly used command line options. For a complete list of command line options, refer to the Advanced Adapter Configurations chapter.
* 
Before using ugbatch, verify that ugpublish is working.
ugbatch Overview
ugbatch batch is used to publish NX CAD data from the command line. ugbatch runs a UG/Open application in non-graphics mode. By typing a simple command at the prompt, CAD data is converted and immediately viewable using Creo View.
Using ugbatch
The operation of the Creo View Adapter for NX involves utilizing a single command to publish CAD data.
The form of command line is as follows:
ugbatch [options] <cad_data>
A command line conversion has the following stages:
1. Open a command prompt and navigate to the directory containing the CAD data NX to convert.
For the purposes of this example, the directory is C:\ug_data\.
* 
The environment of the command prompt must be configured to run NX; for example, the UGII_BASE_DIR environment variable must be correctly set.
2. Type in the ugbatch command, for example:
c:\\ptc\\ug_setup\\ugbatch -p output ug_test.prt
In this example, the command line can be broken down in order, from left to right, as follows:
a. The setup directory containing the adapter configuration, followed by the command to convert the data:
C:\ptc\ug_setup\ugbatch
b. Option -p <output path> is shown as output. This is the name of the directory where the adapter places the converted data.
c. The NX data to be converted is given as ug_test.prt.
3. Press ENTER and ugbatch is launched. When the command prompt returns, the conversion is completed.
* 
ugbatch can publish more than one CAD data at a time. To publish a list of CAD data, type all of the names on the command line separated by a space. Wildcards (asterisks *) can also be used, if the user is confident that the data returned will be correct.
4. You can now open the converted data output in Creo View.
Converting NX Reference Sets
Reference sets are often used to create variances of the CAD data, essentially a new part; for example, engine.prt could contain 2_liter and 3_liter reference sets. When converting this variance type of reference set, the CAD data name must take the following form:
<cad-data-file-name>:Part:<instance-name>
For example, to convert the 2_liter reference set within the engine.prt, use:
engine.prt:Part:2_liter
Reference sets are also commonly used to create a simplified form of an assembly. To convert a simplified form reference set, the following syntax must be used:
<cad-data-file-name>:Form:<simprep-name>
For example to convert the cut_away reference set of engine.prt use:
engine.asm:Form:cut_away
These tags can be combined to convert a simplified form reference set of an variance reference set as follows:
engine.prt:Part:2_liter:Form:cut_away
* 
The order of the tags is important, the :Part: tag must be given before the :Form:.
Was this helpful?