Hallo an das Forum, heute wende ich mich an Euch da ich nicht weiterkomme und ich Unterstützung suche.
ilogic habe ich nachgelesen ist eine tolle Sache, wenn man die Programmiersprache kennt.
Ich habe mir aus dem Internet eine Vorlage geholt und diese funktioniert soweit auch perfekt.
Wir haben DWG`s die auf C\CAD\DWG liegen diese sollen nach dem sie in eine PDF gewandelt sind im
Verzeichnis C\CAD\DWG\DATENAUSTAUSCH\PDF liegen.
Zur Zeit legt er nur ein Unterverzeichnis im DWG-Ordner an ich muss diese aber in einem Unterverzeichnis anlegen
da dort aller Datenaustausch liegt.
Ich hoffe Ihr könnt mir helfen.
Danke
oPath = ThisDoc.Path
oFileName = ThisDoc.FileName(False) 'without extension
oRevNum = iProperties.Value("Project", "Revision Number")
oPDFAddIn = ThisApplication.ApplicationAddIns.ItemById _
("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
oDocument = ThisApplication.ActiveDocument
oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium
If oPDFAddIn.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions) Then
oOptions.Value("All_Color_AS_Black") = 1
oOptions.Value("Remove_Line_Weights") = 1
oOptions.Value("Vector_Resolution") = 400
oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets
'oOptions.Value("Custom_Begin_Sheet") = 2
'oOptions.Value("Custom_End_Sheet") = 4
End If
'get PDF target folder path
oFolder = oPath & "\" & oAsmName & "PDF" !!!!!!!!!!Hier ist der Hund versteckt und ich komme nicht weiter!!!!!!!!!!!
'Check for the PDF folder and create it if it does not exist
If Not System.IO.Directory.Exists(oFolder) Then
System.IO.Directory.CreateDirectory(oFolder)
End If
'Set the PDF target file name
oDataMedium.FileName = oFolder & "\" & oFileName & " Rev" & oRevNum & ".pdf"
'Publish document
oPDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
------------------
HG
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP