Hallo Forum,
ich glaub ich benötige mal eure Hilfe.
Ich bin dabei ein Programm zu schreiben mit dessen Hilfe ich automatisch PDF Dateien aus Proe Dokumenten erzeugen kann. Doch leider hänge ich im Moment an den export optionen.
Die Variable pdfopt ist das Problem.
Hier mal Auszugweise meine Datei.
Imports pfcls
Module Module1
Sub Main()
Dim exePath = "C:\ptc\proeWildfire50\bin\proe1.bat"
Dim WorkDir = "C:\work"
Dim asyncConnection As IpfcAsyncConnection = Nothing
Dim cAC As CCpfcAsyncConnection
Dim session As IpfcBaseSession
Dim test As IpfcModel
Try
cAC = New CCpfcAsyncConnection
asyncConnection = cAC.Start(exePath + " -g:graphics -i:", ".")
session = asyncConnection.Session
Dim descModel As IpfcModelDescriptor
Dim expdf As IpfcPDFExportInstructions
Dim pdfopt As IpfcPDFOption
Dim EpfcPDFOPT_LAUNCH_VIEWER As Boolean
EpfcPDFOPT_LAUNCH_VIEWER = False
descModel = (New CCpfcModelDescriptor).Create(EpfcModelType.EpfcMDL_DRAWING, "test.drw", Nothing)
expdf = (New CCpfcPDFExportInstructions).Create()
pdfopt = (New CCpfcPDFOption).Create()
pdfopt.OptionValue.BoolValue = EpfcPDFOPT_LAUNCH_VIEWER
expdf.FilePath = "c:\work\test.pdf"
expdf.Options = pdfopt
test = session.RetrieveModel(descModel)
test.Display()
test.Export("c:\work\test.pdf", expdf)
Catch ex As Exception
MsgBox(ex.Message.ToString + Chr(13) + ex.StackTrace.ToString)
Finally
'======================================================================
'End the Pro/ENGINEER session when done
'======================================================================
'If Not asyncConnection Is Nothing AndAlso
' asyncConnection.IsRunning Then
'asyncConnection.End()
'End If
End Try
End Sub
End Module
MFG Steinchen
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP