Hi Curtis, it works but not quite....
it prints out the pdf but only produces one pdf and it overwrites it.
heres my ***autopdf illogic rule
Sub Main()
'get drawing border size
Dim drawingsize As String
drawingsize=ActiveSheet.Size
'get filename
Filename=ThisDoc.FileName(False)
'get drawing folder
pdffolder=Left(filename,3)
'get the drawing number
drawingnumber=Left(filename,8)
'set the drawing path
drawingpath="r:\eng\mecdata\mec_dwgs"
'drawingsize=InputBox("Enter The Drawing Size","Drawing Size",size)'MsgBox(drawingsize)
PDFAddIn = ThisApplication.ApplicationAddIns.ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
oDocument = ThisApplication.ActiveEditDocument
oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium
If PDFAddIn.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions) Then
oOptions.Value("All_Colors_As_Black") = 1
oOptions.Value("Remove_Object_Line_Weights") = 0
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
'Set the destination file name
oFolder = drawingpath & "\" & pdffolder & "\PDF\"
oDataMedium.FileName = drawingpath & "\" & pdffolder & "\PDF\" & drawingnumber & drawingsize & ".pdf"
'Check for the DXF folder and create it if it does not exist
If Not System.IO.Directory.Exists(oFolder) Then
System.IO.Directory.CreateDirectory(oFolder)
End If
'Publish document.
Call PDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
MsgBox ("PDF saved to: " & oDataMedium.FileName)
Shell("explorer.exe " & oFolder,vbNormalFocus)
End Sub
the outcome of the pdf goes here: R:\Eng\MecData\mec_dwgs\iLo\PDF then its illogic A.pdf its reading the file that I downloaded from you. also the drawings doesn't close after the pdf is done.