Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch Conversion NX part file to Parasolid 2

Status
Not open for further replies.

Buckshott00

Bioengineer
Aug 10, 2010
229
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
 
Replies continue below

Recommended for you

thanks Cowski,

I tried thread561-270935: 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

 
Buckshott00 said:
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.
 
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
 
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).
 
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?
 
Buckshott00 said:
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.
 
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.
 
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.
 
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?
 
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!!!
 
Glad to help. Thanks for the star, I also gave one to petulf in thread561-270935 as it is his code.

Thanks petulf for posting your code!
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor