Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Writing Journals: Export solid models 1

Status
Not open for further replies.

hurley710

Automotive
Feb 4, 2009
59
0
0
US
I want to write some journals that automate the export of solid models. Parasolids are the preferred type we would like to automate. Is this possible? I don't see a parasolid export as an option for NX5 or NX6. We will be upgrading to NX7.5 mid-summer.
 
Replies continue below

Recommended for you

Exporting a Parasolid is NOT 'journalable' in NX 5.0 or NX 6.0, or for that matter in NX 7.5. Therefore you will need to use NX Open as an alternative and create a custom program to do that.

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA

To an Engineer, the glass is twice as big as it needs to be.
 
You can however automate Iges and I belive you could also automate step using the same methodology that I've seen as these have exe files that you can fire up from a journal.
Not your ideal but a possible solution.

Mark Benson
Aerodynamic Model Designer

To a Designer, the glass was right on CAD.
 
I would like to automate any/all of these formats. Unforunately I think NXOpen is way over my head. Wouldn't even know where to begin.
 
When I said that Exporting a Parasolid was NOT 'journalable' what I meant was that you could NOT record a Journal file which would export a Parasolid since the Export -> Parasolid dialog is not suitable for Journalizing. Granted, one could manually WRITE a journal but that would require at least some programming experience.

Now if you were able to find an existing manually written Journal which does the job great...

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA

To an Engineer, the glass is twice as big as it needs to be.
 
Attached is a VB file to run as a journal for writing out parasolid parts. It asumes you have an assembly then for each component all solid bodies are collected and the component name is changed for wiriting out the parasolid file. This may not be quite what you want. It does show that it is easily done. Let me know if you want it to de different.

Frank Swinkels
 
 http://files.engineering.com/getfile.aspx?folder=056d909d-3827-43d5-aec9-7c11629df5e6&file=ExportParaSolid.zip
Thank you all for your help. I do have limited experience with .vb programming and have customized journals in the past.

@FrankSwinks
I'm not sure if this journal is working. It doesn't give me any errors, however, I'm not being prompted as to where to save the file and I can not locate where its being saved.
In a perfect world, I'd like the journal to be able to export all solid bodies displayed in modeling (not blanked or turned off in layers) whether it be a single component or an assmebly. Then if possible, I'd like to downgrade the parasolid version to NX1.0 and prompt where to save it.
 
The first journal only worked for assemblies. The next journal now tests if the part is a component or piece part. That is the attached journal will now work for either piece part or assembly.

For either we now use parasolid version 14.0 which is suitable for NX1.

For the piece part I disregard blanked solids and if the solid is on a hidden layer.

I don't prompt for a directory. The parasolid file is placed in the path of the partfile. I rename the part file by replacing ".prt" with for example "_bodies_5_xt.x_t". Here 5 is the number of bodies in the file. You will need to let me know how much of the file name you wish to enter or do you want a windows dialog.

Finally let me see if I have it right for an assembly. Do you want only one parasolid file which includes displayed solids in components that are not suppressed or blanked?

Frank Swinkels
 
 http://files.engineering.com/getfile.aspx?folder=21fb75c6-eed9-45f5-9fd9-d512bec5f857&file=ExportParaSolid2.zip
@FrankSwinks
Thanks for your help! The parasolid export does work both with single components as well as assemblies. That is exactly what I needed. However, we have all our cad files in Teamcenter, therefore, it cannot export the parasolid to the same directory. I need to be able to put it in a hard location (i.e. C:/Parasolids). As far as the naming goes, I was thinking of doing something like the following:

Dim strPartNumber as string
Dim strCurrentDate as string

strPartNumber = workPart.GetStringAttribute("DB_PART_NO")
strCurrentDate = format(Today, "MMddyy")

[Export Filename] = "C:\Parasolids" & strPartNumber & "_" & strCurrentDate & ".x_t"

Doing this would take the attribute already assigned as our part number and just add the current date behind it. Thanks again for your help.
 
@FrankSwinks
How can I revise your current journal to set a specific directory for export (i.e. C:/Parasolids)? Thanks in advance.
 
Hi Frank,

I'm new to NX and to this forum so please excuse me. I am trying to export displayed data as parasolid and came across your code. When I tried to run the journal I got a Journal Execution Error stating "No main found."

Can you help me?

Note: I am using NX75.

Thanks
 
I don't know which journal you are refering to. For me to help I will need to see the specific journal.

Please note I will not be available for the next week (in hospital for a knee replacement).

Frank Swinkels
 
I'm referring to the journal posted above my post dated 5 Feb 11 1:35. Filename ExportParasolid3.zip.

I hope the knee replacement goes well and you have a speedy recovery.

Regards
 
OK I am back from the knee replacement.

The journal (ExportParaSolid.vb) uses a naming convention for the parasolid file which is an attribute name (DB_PART_NO). The attribute value together whith a current date is used for the file name. If the attribute does not exist then no parasolid file is created.

Let me know if you want to use some other form of file naming.

Regards

Frank Swinkels
 
Hi Frank,

I am using, your two macros ExportParaSolid2.zip and ExportParaSolid3.zip

The ExportParaSolid2.zip macro works perfect, it generates the parasolid files where the .prt files are located.

But the ExportParaSolid3.zip macro, I execute it and it dosen't tell me where I want to place my parasolid files.

I have added DB_PART_NO, but no luck.

Thanks.
 
Status
Not open for further replies.
Back
Top