ug_inspect

If you have an issue with loading a NX part file or want information about it without opening it in NX

Located in the “UGII_BASE_DIR/UGII/” directory lies an application “ug_inspect.exe“. When you run this application in a command prompt with a location and a part file, it returns more information about the file then you can ever get from within NX. This application has been around in NX for as long as I can remember but it still is not known widely.

Example: note: this is a single line, the web page shows the text wrapped

C:\Program Files\UGS\NX 3\UGII>ug_inspect.exe c:\myParts\myPartFile.prt

output from the “ug_inspect.exe -help”:

Usage: ug_inspect [<switches>] <filenames …>
where </filenames><filenames> are NX part file names, and
<switches> are optional command line arguments which may be
one of the following:
-help prints this message
-rm prints Record Manager partition
-cmod prints CMOD partition
-ess prints the Expresssion partition
-occ prints the Occurrences partition
-path prints Path partitions
-ps prints Parasolid partition(s)
-full prints all partitions
-trace prints tracing info as it reads the part
-cookies prints cookie and object id information
-refs prints most recent referenced part information
-all_refs prints all referenced part information
-scan scans for known part corruptions
-extract_all <part file> [<filename>]
-extract <id> <part file> [<filename>]
Extracts Parasolid transmit files – <id> is a
partition id number, <part fileɬ is a part file name,
and <filename>, if specified, is the filename without
extension to use for generating output file names.
If omitted this is generated from the part file name.
Use -extract_all for pre-v12 part files.
-release Just print release information about the part.

Since you can run this against individual files easily, but many files are teadious. I’ve created a batch script that you drop this script into a directory where NX parts are and run the script. It will then create a subdirectory with an output text file of each file it finds. Edit the script file to do more checks. Currently only the general ug_inspect is run. All the other options are commented out.

The general utility output will tell you a lot about the nx part file. The known corruptions is the best for quickly determining if there is a problem before trying to open in NX.

Output
Some of the information it returns is:

  • Save history: Each time it is saved, who saved it, verion of NX running, date it was saved, if it was renamed
  • Parasolid version
  • Entity types that exist and quantity of each
  • contains foreign data
  • contains compenents or not?
  • if it has pattern data
  • Unique part identifier
  • and many more pieces of output that I’m not sure what they are telling me

Download
Download the ug_inspect.bat file

Moved to nx-tools on Google Code

NX Sample Applications

NX3 has a directory of sample applications

If you need an application to compare drawings, update all drawings, update all features, update all smart models, and about 25 other macro applications look no further then right in the UGII_BASE_DIR. These sample applications are located at: UGII_BASE_DIR/UGSAMPLES

These applications are very usefull not just for what they do but the outline on how to build on the existing code and do other tasks. For example the update all features should be run each time your site is migrating from one version of NX to another. This should happen well in advance of the migration to verify if there are going to be any issues in production. Then once you have the files that migrate correctly and refile should take place after you have gone into production. That way all your files are at the current version, you know they will migrate, you won’t be left trying to upgrade a part on the designers machine hoping it works, and if in a few years you want to open an very old file the version jump will be less. You should be able to open any version of NX in a newer version but if there is a problem it will be very difficult to fix if the original version is no longer installed.

Each new version of NX they checking of the parts get better and better, the next version of NX may find an issue with your current of NX. So if you do a dry run of all your parts in a update all features you can have a piece of mind knowing that any production issues will be less if at all.

Forums are open

The PlmExchange.net forums are up and running. Join the PLM community and post questions, solutions, etc..

Link to the forums: forum.plmexchange.net

NX/Open Sample Applications

NX3 ships with many sample NX/Open applicatons

The sample applications are located at: UGII_BASE_DIR/UGOPEN/SampleNXOpenApplications, default location is: C:\Program Files\UGS\NX 3.0\UGOPEN\SampleNXOpenApplications

These sample applications are mostly .Net based technology. They use either VB (visual basic) .Net or C# (C Sharp) .Net, with a couple of applications that are C++ based in NX/Open.

c# samples:

  • AssemblyViewer
  • CycleAssemblies
  • InteropNXOpenWithUFWrap
  • NXOpenExamples
  • SnagImage (c# version)

vb samples:

  • CreateNote
  • DrawingCycle
  • DrawText
  • FeatureBrowser
  • File2Points (with a Grip file for comparision)
  • FilloutTitleBlock
  • LayerOrganize
  • PolygonTool
  • Preferences
  • QuickExtrude
  • Selection
  • SketchShape
  • SnagImage (vb version)
  • SpellChecker
  • TitleBlock

c++ (C Plus Plus) samples:

  • File2PointsCPP
  • InteropNXOpenWithUFunc

As you can see the majority of sample applications are written in vb (visual basic). Probably because that is the target audience for getting quick applications up and running. For C++ programmers and C# programmers they probably assume they’ll figure it out anyways. That is just a guess. Regardless of they type of programmer you are, which language you previously worked on you’ll see examples on how to use the NX/Open api namespaces to build your applications.

There will be another post of a step by step on creating a NX/Open application wired to a winform dialog.

Jones Apparel Group, Inc. Announces Successful Initial Implementation of UGS Corporation’s Enterprise Product Lifecycle Management ApplicationUGS Newsroom (RSS Feed)

Link to originating site

« Previous Entries