Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

NX5 - AUTOMATE PDF EXPORT? 3

Status
Not open for further replies.

hurley710

Automotive
Feb 4, 2009
59
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

moog2,
I have installed edrawings and now I better understand the problem. Try the new & improved attached version, I can't give it 100% guarantee, but it worked in my testing.

jkcone,
I can't comment on ACAD as I do not have it to test with, but using the CGM method the hidden lines translate correctly to the edrawings viewer. I worked on ACAD years ago and seem to remember there is a setting for linetype scale (LINESCALE maybe?). Perhaps this setting is too large in ACAD making a dashed line appear as a solid line (essentially one long dash)?
This thread has also surprised me as to how long it has become. I don't think it is a record setter, but I have not seen one this long in the NX forum since Things UG needs to FIX!!! or something along those lines.

uwam2ie,
Thank you for the comment
notice that also in dxfdwg export a view option is aviable
as that sparked an idea which I hope is the solution for this journal. Also, I would still love to see what settings you use for successful DXF export so that CGM's will not need to be used.



 
 http://files.engineering.com/getfile.aspx?folder=3f2fbe19-f50e-401c-adab-22c97f16f439&file=moog_s_export_dxf_2.vb
Perhaps you will share with us the settings you use?
some advice ... worked for me
-control the visualisation setting on view
-use the oldest dwg dxf Acad version (R14)
- activate drawing view style extracted edges
-use line,character or color mapping files for dxfdwg (advanced)
-for set up/control tests use the Ugpart output in 2dexchange
review the results control if everything is plain - whats lost ;-) use the plain part for dxf dwg to optimize this translation.
setting should be optimized (cotrolled)to the destinated cad solution or view -
hope it helps


 
Hi uwam2ie, thanks for your input.
I'm not clear as to what all settings your talking about (I'm relatively new to UG). Please let me know, I'll be happy to list them. Are these settings under the Customer Defaults or the settings in the individual files?

I'm not sure what you mean by "-control the visualisation setting on view"?

I tried the R14 setting but it didn't seem to make any difference.

Didn't have any luck figuring out the "- activate drawing view style extracted edges" setting.

No luck with "-use line,character or color mapping files for dxfdwg (advanced)" either.

I did use the 2D exchange.

Acoording to this I'm pretty munch in the dark :(
If you'd like to respond back maybe I;ll help me get up to speed.

I did run across a new result thought. If I export a metric file to DWG with 2D exchange the hidden lines shows decent, not great but decent. Kinda coarse.

uwam2ie, are you able to export an NX inch drawing with 2D exchange & have the hidden lines show up correctly without modifying them in Acad?

Thanks for your help,
James
 
Does anybody have any knowledge on how to set the .vb journal to retrieve the date. I need it to display the date as numbers only. For example, today is April 09, 2010. I need it the file to retrieve the date and display it as "040910."
 
cowski,

Hello again! Hope all is good. My journal is complete and has been implemented. Now I'm just tweaking it here and there to make it nicer. I figured out how to retrieve the date. I just can't figure out how to display it has the default value for an input box:

strCheckDate = workPart.GetStringAttribute("CHECKED DATE")
strCheckDate = InputBox(prompt:="Enter Checked Date")
workPart.SetAttribute("CHECKED DATE", strCheckDate)
 
To retrieve a string with the desired date formating you can use the Today objects ToString() method,

System.DateTime.Today.ToString("MMddyy")

Hurley I think the following should do what you want.

Dim strCheckedDate As String = WorkPart.GetStringAttribute("CHECKED DATE")
strCheckedDate = InputBox("Enter Checked Date: ","", strCheckedDate)
WorkPart.SetAttribute("CHECKED DATE", strCheckedDate)




 
Cowski,
Thanks again for your continued commitment to a solution for this long standing UG floor, and congratulations on a well oiled, working solution, you ARE indeed, "the man"...
 
Doh, i tested it on a 32bit, and it works fine, but on 64bit,windows 7 it stalls and gives this error.

NXOpen.NXException: Orignal view to replace in layout is invalid
at NXOpen.Layout.ReplaceView(ModelingView oldView, ModelingView newView, Boolean performFitView)
at NXJournal.Main() in C:\Users\Moog\AppData\Local\Temp\NXJournals3600\journal.vb:line 130
 
I'm glad to help out where I can, unfortunately I do not have any version of windows other than XP (32 bit) to test with.

NX said:
Orignal view to replace in layout is invalid
Does it return the same error for every part? This line of code is simply trying to perform a 'replace view' to switch to the top view. Try doing this manually (right click in the model view -> Replace view -> Top view) and see what happens.
 
With my .pdf export, I like how the drawings are displayed as landscape (the way a drawing would typically look). However, once you go to the print drawing, by default, it prints it landscape on a portrait setup. Not sure if I'm doing the best job of explaining, so I've attached a sample .pdf. Any ideas?

 
 http://files.engineering.com/getfile.aspx?folder=181a2bb7-b958-4fc6-8190-7b29d88f836b&file=TEST.pdf
Yes that is correct. However, when you go into the print settings, by default, it wants to print the landscape drawing on portrait setup (see attached image). Is there a way to set up my journal to make this a landscape print setup by default?
 
 http://files.engineering.com/getfile.aspx?folder=8a4fbe18-541e-4105-9370-f8a5cde637bc&file=TEST_PRINT_LAYOUT.JPG
Aha! Now I understand.

Try turning on the "Auto rotate and center" option on the print dialog.
 
That actually works. Thanks. Originally I was trying to do it as an output right from NX, but that'll still work for what we need it to do.
 
Cowski,
Yes, i get the same error for every part, and the replace view, in modelling, works fine??
 
Are you using the 64 bit version of NX? What revision level of NX are you using? Try recording a journal to replace a view and play it back in some different files and see what happens; if it works then it is probably due to a version difference.

I don't have any better ideas right now.
 
@cowski,

Now that my .pdf export is off and working, I thought I'd give your dxf export a shot, since its such a nuisance to always export a .cgm, re-import, and externally translate to a .dxf. I downloaded your latest .vb file for this and it kicks back a cgmbuilder error. Thought you could explain. Thanks in advance.
 
 http://files.engineering.com/getfile.aspx?folder=8350418d-8441-42b4-a541-b9ef2070bb4e&file=dxf_export.JPG
hurley710,
Are you still running NX5? The journal was created in NX6, CGMBuilder may not be supported in NX5.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor