Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

NX5 - AUTOMATE PDF EXPORT? 3

Status
Not open for further replies.

hurley710

Automotive
Feb 4, 2009
59
0
0
US
Currently, we export drawings into an Electronic Data Management System using GRIP. Drawings are released into .hgl format. Is there a way to automate an export of these drawings as .pdf?
 
Replies continue below

Recommended for you

I would look at using a journal. What exactly would you like to happen? Do you have multi-sheet drawings? If so, do you want these as multiple pdf files or not? Do you need to import these into another application?
 
Yes, at times, there are multiple sheets in the file. But for the most part, this could be done individually as separate PDF's. As an end result, I would like to be able to create a .pdf file of the current drawing sheet in a specified directory as easy as possible. This would be for other departments that don't use CAD to be able to view our drawings.
 
Journal definitely seems like a good option to look into. One thing I need to figure out is if I can set it up to prompt for the saved file name and destination directory. If I could set it up to be smart, based on the part number attribute, I'd be golden.
 
First off, thank you for everything. You've already opened the door to a lot of ideas I haven't really thought about. I believe all I need is to create a journal that looks at the value of a particular part attribute (in my case, its named DRAWING_NUMBER) and save a .pdf as that value. I was incorrect earlier when I said I would need to vary its destination. All .pdf's could be saved in the same directory (which will not be the same directory as the file. We actually use Teamcenter).
 
I'm looking to do something similar, except along with the pdf, I'd like it to create a Parasolid, IGES, and STEP file.

So where do I start? Record a journal to do what I want, and then find a Visual Basic coder to help me modify it?

-Dave
Everything should be designed as simple as possible, but not simpler.
 
Recording a journal is a great place to start. From there you have to generalize it a little, otherwise it looks for the specific objects you picked when you recorded the journal.

I have another journal that outputs a parasolid, I'd be glad to get you started. I got some help for it on this forum, if you search for 'journal output parasolid' you will probably find the code. I'm a bit tied up this morning, but I should be able to post something more useful this afternoon or tomorrow.

Do you have multiple sheets and solid bodies in your file that you want output as parasolid, STEP, and IGES? If so, do you want all of them to be output or only 1 specific solid body?
 
Just as fair warning, I have zero experience with Journals, VB, etc. I suspect this may be beyond my usual "dive in and hack my way thru it" way of doing things :)

Some drawing files will have multiple sheets. Model files should only have one solid that should be exported, but I can't guarantee someone doesn't have reference solids in the file. Because of this, I'm wondering if rather than automating the process, I should look to make it a 'guided process', ie run the journal, but get prompted to select the solid, etc. It wouldn't speed the process, but the hand-holding approach would ensure that all of the required files are created.

Also, we're using Teamcenter, so to have the files saved into TC automatically would be a bonus.

-Dave
Everything should be designed as simple as possible, but not simpler.
 
Gunman,
Here is a starting point for you. A few words of warning are in order:
1) if your drawings use the 'master model' approach, the STEP and IGES export won't work. Apparently, STEP and IGES do not see a component as a valid entity to export, but the parasolid export works just fine.
2) you will have to open the journal file and edit the location of your STEP and IGES settings files. Look for the lines "Const stepSettingsFile as string =..." and "Const igesSettingsFile as string = ..." near the beginning of the file.
3) I am not running teamcenter, so I do not know how to save files into TC. Perhaps someone else on the forum can help you with that aspect.
4) The journal has worked in my limited testing, but I do not guarantee it to be bug free. Please post any problems you have with it.

 
 http://files.engineering.com/getfile.aspx?folder=9e4d939f-73ab-45a0-9d2c-589c093bc426&file=export_pdf_and_parasolid.vb
cowski,
My journal writing has been a success! My only snag is I still am not sure how to get it to point to an attribute. Is it possible to point to an attribute name to save as the output .pdf? I would like the .pdf to be saved as the value of the attribute "PART_NUMBER"
 
You will have to declare the variables before you use them. Near the top of the journal with the other "Dim" statements add:
Code:
Dim strPartNumber as string
Dim pdfFile as string
 
Very nice journal app
I normally go all this manually when data comes in and needs to be available to others who don't run UG.

What would need to be modified to allow the selection of sheet bodies as well?

Rob
 
Cowski,
both your vb files are awesome, but could i trouble you to modify the for me (i've tried)
I want them to be named from the component (master model), not the drawing file, and i'd like them to output to a specific directory, eg. X\pdf's.
Help appreciated...
 
Status
Not open for further replies.
Back
Top