Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Setting Line widths for PrintPDFBuilder

Status
Not open for further replies.

NXGrunt

Mechanical
Oct 27, 2008
6
Hi,
I am beating my head against a wall trying to get the Journal I am using to export PDFs to set the line widths.

See Code snippet below, The variable 'thinLineWidth' is a Boolean. If it is true I get the correct thin line output from the PDF. If it is false, I should get the custom three widths but the output PDF does not change.

I did record a few journals while exporting a few PDFs to analyze the code there and I don't see what could be missing. Other than widthDefinition1.Use is set to 0 for single width and 1 for custom three widths. I have tried including it in the code but I get no change to the output.

The log file shows all the variables are set to the correct values.

Help Please!

Code:
		'Set Custom Widths
			printPDFBuilder1.CreateWidthDefinition().GetCustomWidths(0).Width = 0.252 
			
			printPDFBuilder1.CreateWidthDefinition().GetCustomWidths(0).Name = "PDF Custom Normal" 
			
			printPDFBuilder1.CreateWidthDefinition().GetCustomWidths(1).Width = 0.42 
			
			printPDFBuilder1.CreateWidthDefinition().GetCustomWidths(1).Name = "PDF Custom Thick" 
			
			printPDFBuilder1.CreateWidthDefinition().GetCustomWidths(2).Width = 0.08 
			
			printPDFBuilder1.CreateWidthDefinition().GetCustomWidths(2).Name = "PDF Custom Thin" 
		
		
		If _thinLineWidth Then
			lg.WriteLine("	PDF Output Set to Thin Line Width")
			printPDFBuilder1.Widths = PrintPDFBuilder.Width.SingleWidth
			printPDFBuilder1.CreateWidthDefinition().SingleSource = 2
		Else
			lg.WriteLine("	PDF Output set to Custom Three Width")
			printPDFBuilder1.Widths = PrintPDFBuilder.Width.CustomThreeWidths
		End If
		
		lg.WriteLine("	Single Source: " & printPDFBuilder1.CreateWidthDefinition().SingleSource.ToString)
		lg.WriteLine("	Custom Width(2) size: " & printPDFBuilder1.CreateWidthDefinition().GetCustomWidths(2).Width.ToString)		
		lg.WriteLine("	Custom Width Name(2): " & printPDFBuilder1.CreateWidthDefinition().GetCustomWidths(2).Name.ToString)	
		lg.WriteLine("	Widths: " & printPDFBuilder1.Widths.ToString)
		lg.WriteLine("	ThinLineWidth: " & _thinLineWidth.ToString)
 
Replies continue below

Recommended for you

I recorded journal and I think that You have to use:

Code:
printPDFBuilder1.Widths = NXOpen.PrintPDFBuilder.Width.CustomThreeWidths
printPDFBuilder1.DefineWidths()

Dim widthDefinition1 As NXOpen.WidthDefinition = Nothing
widthDefinition1 = printPDFBuilder1.CreateWidthDefinition()

widthDefinition1.Use = 1
widthDefinition1.Single = 0
widthDefinition1.SingleWidth = 0.25
widthDefinition1.SingleSource = 0

Dim customwidths1() As NXOpen.CustomWidth
customwidths1 = widthDefinition1.GetCustomWidths()

customwidths1(0).Width = 0.252
customwidths1(0).Name = "PDF Custom Normal" 

customwidths1(1).Width = 0.42 
customwidths1(1).Name = "PDF Custom Thick" 

customwidths1(2).Width = 0.08
customwidths1(2).Name = "PDF Custom Thin"

There is a comment on recorded code:
' WARNING: use of customwidths1(0) may be unreliable on replay





With best regards
Michael
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor