×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Batch Conversion NX part file to Parasolid
2

Batch Conversion NX part file to Parasolid

Batch Conversion NX part file to Parasolid

(OP)
Hello,

I am running NX7.5.4.4 on Windows 7pro 64 bit.  I would like to convert the contents of a directory from Part files to parasolid files.

We have have some clients who have requested all parasolids.

If this option doesn't exist does anyone know the location of a journal or other NXopen type program that will do this?

Thank you

RE: Batch Conversion NX part file to Parasolid

(OP)
Thanks John,

I tried that first but only got a bunch of errors when I tried that program.
 

RE: Batch Conversion NX part file to Parasolid

Check out the ug_inspect command. It used to have an option to export the Parasolid data and do all files in a folder.

Or is my memory fading?
 

"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli

RE: Batch Conversion NX part file to Parasolid

(OP)
Is that the license controlled portion UG Inspect?  because I don't have that module, but if you're talking about a different command please let me know.

RE: Batch Conversion NX part file to Parasolid

ug_inspect is a utility program (run outside of NX) provided by Siemens, you can find it in the UGII subfolder of your NX install. If you search the help files on the term ug_inspect, you will get information and examples of how to use it.

RE: Batch Conversion NX part file to Parasolid

If you open a command window and set your directory to the ugii folder of your NX install, then enter ug_inspect -h for the comand syntax and parameters.
 

"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli

RE: Batch Conversion NX part file to Parasolid

(OP)
Do you guys have an example I am able to access the command prompt but this old school command line stuff is a bit difficult

Thanks

RE: Batch Conversion NX part file to Parasolid

Start, All Programs, Siemens NX 8.0 (or whatever release), NX Tools, Command Prompt. Type ug_inspect.
All the information, including extracting Parasolid, is there.

Mark Rief
Product Manager
Siemens PLM

RE: Batch Conversion NX part file to Parasolid

cowski, I guess we just got called 'old'! :) I earned every one of my grey hairs from my kids.

You need to open the command prompt window from the NX menu, so you get the proper environment settings. Then just enter (without the quotes) 'ug_inspect -h'. This will list the options for the ug_inspect command.

Basically, if your files to export are in a single directory, use the cd (chnage directory) command to put you in that directory. Then you can run ug_inspect to extract the Parasolid data.
 

"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli

RE: Batch Conversion NX part file to Parasolid

(OP)
Mark

I was talking about the the Command prompt area, all the commands are listed but I'm still a bit lost.  If I am trying to batch convert do I list the directory, or do I list every part file in the directory?  Do I have to have a separate transmit file for each one? An example on the proper format would go a long way.

RE: Batch Conversion NX part file to Parasolid

(OP)
looslib,

To be fair I said Old School, which is still cool bigglasses  Also to my generation anything pre NX3 is old.

I've gotten that far, but when I try to extract file or even individual files I get messages regarding transmit files etc.

Thanks

RE: Batch Conversion NX part file to Parasolid

(OP)
Changed Directory: done
Any ug-inspect command after that: could not open ... status 1

doesn't that mean I have the command wrong?

RE: Batch Conversion NX part file to Parasolid

If you only get ug_inspect information when in the ugii directory, then you don't have the proper environment variable set to allow the command to run from another directory. Try runing the command line with the full path: <ug_loadpoint>/ugii/ug_inspect. <ug_loadpoint> is different if your install did not use the default settings.

Since I started on UGII V3, I guess I am "old school", as well as old!
 

"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli

RE: Batch Conversion NX part file to Parasolid

Quote (Coach Z):

I'm so old school, dey tore da school down!!

RE: Batch Conversion NX part file to Parasolid

(OP)
loolib,

I can get just about everything but the part file.  It might be that it is making the Parasolid and putting it in a temp drive.

@cowski  Good Jorb!

RE: Batch Conversion NX part file to Parasolid

(OP)
I can extract a .jt file but not a parasolid, and it places the .jt in the UGII directory

RE: Batch Conversion NX part file to Parasolid

I don't have NX where I work now, so all of this is coming from memory. Someone with NX will have to take you further if you aren't getting the Parasolid file created from the command line. I would guess that it would put the file in the directory that you execute the ug_inspect command from.
 

"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli

RE: Batch Conversion NX part file to Parasolid

(OP)
WOW!!! surprise  That's impressive from memory!

I was able to get 1 parasolid out of the directory, but I keep getting errors about psuedo entries.

Thanks again for the help.

RE: Batch Conversion NX part file to Parasolid

One caveat I just thought of, if you use the command line option it will probably output all sheet and solid bodies in the file. This may or may not be what you want, just thought I should point it out.

Here are a few relevant threads:
thread561-137205: Exporting Multiple Parasolids
contains usage of the ug_inspect program and a possible batch file.

Quote (uwam2ie):

md %temp%\clncall
%UGII_BASE_DIR%\UGII\ug_inspect -extract_all %1
rem %temp%\cln\
pause
To use this code, copy and paste it into notepad, name it and make sure the extension is .bat. Drag and drop your part file onto the .bat file (in windows explorer). It references your temp directory, I assume it will extract the parasolid there, but I have not tested it.

thread561-270935: Automating the export of multiple parts as parasolid files
petulf posted a journal program to export parasolid files in this thread.

RE: Batch Conversion NX part file to Parasolid

(OP)
thanks Cowski,

I tried thread561-270935: Automating the export of multiple parts as parasolid files: Automating the export of multiple parts as parasolid files but I couldn't get petulf's journal to work correctly, I kept getting lots of errors

as for the first part, are you saying I should move all the part files I want translated in a directory to a batch file and tell the ug_inspect command to inspect the batch file?

Thanks

 

RE: Batch Conversion NX part file to Parasolid

Quote (Buckshott00):

are you saying I should move all the part files I want translated in a directory to a batch file and tell the ug_inspect command to inspect the batch file?
No, that won't work.

If you make that batch file, it will call the ug_inspect program and it will operate on the part file that you pass to it. If you name the batch file extract.bat, you can call it from the command line like: C:\parts\extract.bat C:\parts\mypart.prt (assuming the batch file and your parts are in C:\parts) or open windows explorer and drag&drop a part file of your choice onto the extract.bat file.

If you get ug_inspect to work as you want, we can come up with a more robust script file to work on multiple files, directories, etc.

RE: Batch Conversion NX part file to Parasolid

(OP)
ug_inspect -extract 20 StartDirectroy\FileName.prt EndDirectory\ParasolidName

This script works to get single files translated into their desired location with the desired part name but I have been up able to adapt it to multiple files or the whole StartDirectory as desired.

It also still gave me a warning about a pseudo entry which I am still trying to find out what that is  

RE: Batch Conversion NX part file to Parasolid

Do the files with pseudo entries fail to create a parasolid file, or is it just an informational warning?

I'd try a part cleanup on the file(s) that give warnings about pseudo entries. Also, just a guess, I'd check to see if those parts had any interpart links (wave, promote, etc).

RE: Batch Conversion NX part file to Parasolid

(OP)
I think it is just an informational warning.  I was getting the warnings back when it was failing to make the Parasolids as well.

I think you're probably right about it being the wave link.  Practically everything we do is linked back to an early stage in it's manufacturing life, so that's probably the warning.

Any clue as to what the number is after the extract command?

RE: Batch Conversion NX part file to Parasolid

Quote (Buckshott00):

Any clue as to what the number is after the extract command?
It is a partition ID number, probably something to do with the file's internal structure, though I don't really know for sure.

RE: Batch Conversion NX part file to Parasolid

I ran a quick test on a small part. Using the "-extract 20" syntax I get nothing; I tried the "-extract_all" option and got 13 separate parasolid files each containing an individual sheet or solid body from the prt file. Each file is appended with a number, when I delete those files and try the extract command with one of those numbers it works. Each body must get its own partition in the file, using 20 for every file 1)probably won't work on every file you have and 2)if it does, may not return the body you are interested in.

We may have to revisit using a journal in batch mode. How consistent are the files you have? Does each file have the main model on a certain layer (layer 1 perhaps)? If so, perhaps we could write/modify a journal to export everything on layer X to a parasolid file, or use some similar strategy.

RE: Batch Conversion NX part file to Parasolid

(OP)
I'm willing to give it a shot.  It just seemed like the journal file was more work due to all the errors.

All of the parts should be very consistent and should have the parts on either layer 23 or 26.  I would like to know what in the code needs to be declared or changed in order to get it to work.

RE: Batch Conversion NX part file to Parasolid

(OP)
Your journal in the other thread looks good maybe you could add a shell and have it open every part in a given directory, and then create parasolids of every open part?

RE: Batch Conversion NX part file to Parasolid

(OP)
Nailed It!! Thanks Cowski, I was wondering why it was making references to forms I couldn't see.

Works like a charm thanks for all your help!!!

RE: Batch Conversion NX part file to Parasolid

(OP)
I gave him a star as well  Big Thanks to petulf!!  2thumbsup

RE: Batch Conversion NX part file to Parasolid

New to the forum and Unigraphics.  
I am running NX7.5.  I would like to export out parasolids of my assemblies in a batch mode.  I downloaded the code, psBatchExport,  and saved in my UGII dir.  I run the script and it gives me an error that reads 'Unable to cast object of type NXOpen.NXObject to type NXOpen.Part'.  Please advise.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources