Inventor General Discussion

Inventor General Discussion

Reply
Distinguished Contributor
yannicknielsen
Posts: 112
Registered: ‎05-13-2013
Message 1 of 1 (708 Views)

Task Scheduler 2014 migration and PDF creation

708 Views, 0 Replies
05-13-2013 06:18 AM

Hi there

 

Today I decided to migrate all the files of one of my projects, and I realised that Task Scheduler would also save all my files and create PDFs of the .DWGs. I guess it saved PDFs of my DWGs because I have a rule making it do so after save.
I was happy.. that is, until I realised that it did a horrible job at creating the PDF files with missing lines and everything!

 

The odd thing, now, is that while the Task Scheduler did a horrible job, I can now open a drawing, just save it, and I have a perfect PDF file. It's the same Ilogic rule and everything!

 

If necessary you can find my PC specs in the bottom of the message, and I'll also paste my PDF rule and a few examples of Task Scheduler vs. opening and saving them manually.

 

If anyone has a fix for it, it'd be most appreciated! :smileyhappy:

 

 '------start of iLogic-------
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

'Define the drawing 
Dim oDrawing As DrawingDocument
oDrawing = ThisDoc.Document

'set PDF Options
If oPDFAddIn.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions) Then
oOptions.Value("All_Color_AS_Black") = 1
oOptions.Value("Remove_Line_Weights") = 1
oOptions.Value("Vector_Resolution") = 600
oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets
End If

If oRevNum = ""
 'Set the PDF target file name
 oDataMedium.FileName = oPath & "\" & oFileName & ".pdf" 
 Else
'Set the PDF target file name
oDataMedium.FileName = oPath & "\" & oFileName & " Rev" & oRevNum & ".pdf"
End If

'Publish document
oPDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)

'------end of iLogic------- 

 

Unfortunately due to company policy I cannot give you the full documents. I hope what I have provided is enough!

---------------------------------------------------------------------------------------------------------------------
Product Design Suite Ultimate 2015
Inventor 2015 Professional
Windows 7 Professional 64 bit
Intel Xeon E3-1240 @ 3.4 ghz
Nvidia Quadro 600
8.00 gb RAM
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!