Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

PDF Export Journal 1

Status
Not open for further replies.

hurley710

Automotive
Joined
Feb 4, 2009
Messages
59
Location
US
Hello All,

I've written NX Journals to export the current drawing sheet as a .pdf with no problem.

dim shtName as string = workPart.DrawingSheets().CurrentDrawingSheet.Name()
Dim sheets1(0) As NXObject
Dim drawingSheet1 As Drawings.DrawingSheet = CType(workPart.DrawingSheets.FindObject(shtName),
Drawings.DrawingSheet)
sheets1(0) = drawingSheet1
printPDFBuilder1.SourceBuilder.SetSheets(sheets1)


I can easily do it also as two sheets with no problem.

Dim sheets1(1) As NXObject
Dim drawingSheet1 As Drawings.DrawingSheet = CType(workPart.DrawingSheets.FindObject("SHT1"), Drawings.DrawingSheet)

sheets1(0) = drawingSheet1
Dim drawingSheet2 As Drawings.DrawingSheet = CType(workPart.DrawingSheets.FindObject("SHT2"), Drawings.DrawingSheet)

sheets1(1) = drawingSheet2
printPDFBuilder1.SourceBuilder.SetSheets(sheets1)


Unfortunately, my company creates drawings interchangeably, as both one sheets or two. It'd be nice to do this all as one journal. I'd like to create .pdf export journal that will check how many sheets are in the workpart and then export those to the set destination. Can anyone give any help on this? Thanks so much in advance.
 
You can pass all the drawing sheets to the sourcebuilder in one shot, no need to pass them in one at a time.

The following line will add all the drawing sheets to the sourcebuilder; you should probably check that there is at least 1 sheet before doing this...

Code:
printPDFBuilder1.SourceBuilder.SetSheets(workPart.DrawingSheets.ToArray)

www.nxjournaling.com
 
Cowski,

Thanks for your help! I figured it was a simple naming convention I was missing. You always pull through!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top