- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So, we've run into an odd issue. We have had an addin here for a long time that kicks out pdfs. No one has had an issue with it before. We recently brought in another branch of the company into our system. For us, a large IDW file might have had 5 sheets in it. For them, it is not uncommon to cross 100 sheets.
All that said, when they run the command to send all sheets to individual pdf's on 124 sheets, it takes close to 3 HOURS to complete - which is just not right at all.
If I use the file raw and disable Vault and ilogic, i still get over 1 minute per file. However, if it remove some sheets i get MUCH different results:
5 sheets: 1 second per sheet (if that)
25 sheets: 3 seconds per sheet
50 sheets: 6ish seconds a sheet
124 sheets: jumps to 1 minute per sheet.
To make matters worse, they have an ilogic routine that can kick out all 124 sheets in 5 minutes. The PDF portion of the code looks to be exactly the same settings we use, so i'm at a loss as to why the ilogic version zips through and the full blown addin drags so bad with large files.
I've not run across anything like this and I was wondering if anyone had seen or had any ideas.
Debugging it, it gets directly to the PDFAddin.SaveCopyAs line immediately with no delay. It's executing that line that has the problem. I just cannot think of anything that would delay things so badly on an addin because of the number of sheets.
Below is the relevant part of the code:
Inventor.TranslatorAddIn PDFAddin = (TranslatorAddIn)Globals._InvApp.
ApplicationAddIns.ItemById["{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}"];
//set ref to the document
DrawingDocument oDoc = (DrawingDocument)Globals._InvApp.ActiveDocument;
//set translation context
TranslationContext oContext = Globals._InvApp.TransientObjects.CreateTranslationContext();
oContext.Type = Inventor.IOMechanismEnum.kFileBrowseIOMechanism;
//create name value map
NameValueMap oOptions = (NameValueMap)Globals._InvApp.TransientObjects.CreateNameValueMap();
//create a data medium object
DataMedium oDataMedium = (DataMedium)Globals._InvApp.TransientObjects.CreateDataMedium();
if(PDFAddin.HasSaveCopyAsOptions[oDoc, oContext, oOptions])
{
//listing all options for reference
oOptions.Value["All_Color_AS_Black"] = true;
//oOptions.Value["Remove_Line_Weights"] = 0;
oOptions.Value["Vector_Resolution"] = 600;
//if (showPDF)
//{
// oOptions.Value["Launch_Viewer"] = 1;
//}
//else
//{
// oOptions.Value["Launch_Viewer"] = 0;
//}
oOptions.Value["Launch_Viewer"] = 0;
if (allSheets == false)
{
oOptions.Value["Sheet_Range"] = PrintRangeEnum.kPrintCurrentSheet;
}
else
{
oOptions.Value["Sheet_Range"] = PrintRangeEnum.kPrintSheetRange;
oOptions.Value["Custom_Begin_Sheet"] = customSheet;
oOptions.Value["Custom_End_Sheet"] = customSheet;
}
}
oDataMedium.FileName = pdfPath + @"\" + myPDF;
PDFAddin.SaveCopyAs(oDoc, oContext, oOptions, oDataMedium);
Solved! Go to Solution.