12-05-2017 01:39 AM
Hello,
I have a bit of my macro which saves a pdf, but now i want to export the asm or par as 3d pdf, can you guys point me in the right direction and/or help me a bit?
This is the code to save my draft as pdf, which isn't neccesary anymore, because we use an add-in which exports a pdf every time i save the document.
And i know i have to change some more things, because it was used to be for the draft environment.
Private Sub Button_SaveAsPDF_Click(sender As Object, e As EventArgs) Handles Button_SaveAsPDF.Click Form1.SEDraftDocument = Main.seApp.ActiveDocument 'Het pad specificeren waar het bestand moet worden opgeslagen Dim SESaveAsPDFPath As String SESaveAsPDFPath = TextBox_OpslaanIn.Text & "\" & TextBox_Bestandsnaam.Text & ".pdf" 'Extra check zodra bestandsnaam wordt gewijzigd --> infobox If TextBox_Bestandsnaam.Modified = True Then Select Case MsgBox("Weet je zeker dat je de bestandsnaam wilt wijzigen?", MsgBoxStyle.YesNo, Title:="Bestandsnaam gewijzigd") Case MsgBoxResult.Yes Form1.SEDraftDocument.SaveAs(SESaveAsPDFPath) Me.Close() Case MsgBoxResult.No Main.SEDocumentPropertySets = SEModelDocument.Properties 'Vul bij bestandsnaam de document number van het gelinkte model + de bestandsnaam zonder extensie For i As Integer = 1 To Main.SEDocumentPropertySets.Count Main.SEDocumentProperties = Main.SEDocumentPropertySets.Item(i) For j As Integer = 1 To Main.SEDocumentProperties.Count Main.SEDocumentProperty = Main.SEDocumentProperties.Item(j) If Main.SEDocumentProperty.Name = "Document Number" Then TextBox_Bestandsnaam.Text = Main.SEDocumentProperty.Value & " " & SEDocumentName(0) End If Next Next End Select Else Form1.SEDraftDocument.SaveAs(SESaveAsPDFPath) Me.Close() SESheetWindow.Update() End If 'Check of de draft al is opgeslagen If Form1.SEDraftDocument.Path = "" Then Select Case MsgBox("Het draft document is nog niet opgeslagen. Wilt u deze nu opslaan?", MsgBoxStyle.YesNo, Title:="Draft niet opgeslagen") Case MsgBoxResult.Yes Form_SaveAs.Show() Me.Close() End Select End If End Sub
Thanks folks!
Solved! Go to Solution.
12-05-2017 02:23 AM - edited 12-05-2017 02:25 AM
Hi @JuRi
try to modify the save line for the PDF with ...(SEPDFPath, ,True)
This additional parameter (which IMHO is not described in any documentation) gives a 3D PDF as output format, rather than a 2D PDF
12-05-2017 10:43 AM
This seems to return just the normal pdf for me. I've put some thing of the code underneath. my SESaveAsPDFPath returns ............................\filename.pdf
Public SEPartDocument As SolidEdgePart.PartDocument
SEPartDocument = Main.seApp.ActiveDocument
Dim SEPartDocumentpath() As String
SEPartDocument.SaveAs(SESaveAsPDFPath, True)
12-05-2017 11:43 AM
Hi @JuRi
double commas!
SEPartDocument.SaveAs(SESaveAsPDFPath, ,True)
JuRi schrieb:This seems to return just the normal pdf for me. I've put some thing of the code underneath. my SESaveAsPDFPath returns ............................\filename.pdf
Public SEPartDocument As SolidEdgePart.PartDocument
SEPartDocument = Main.seApp.ActiveDocument
Dim SEPartDocumentpath() As String
SEPartDocument.SaveAs(SESaveAsPDFPath, True)
12-06-2017 01:38 AM
Thanks! This did the trick.