Search code examples
pdf-generationautodesk-forgeautodesk-designautomation

Inventor Pdf Translator SaveCopyAs SVxApp::CareForAllExceptions()


My APS activity has been producing PDFs many years. Starting last week some designs would work fine but today no scenario is working. This same code executes on my desktop just fine with Inventor 2020, 2022, 2024.

GDI_Objects seems to be a graphics limitation https://www.autodesk.com/support/technical/article/caas/sfdcarticles/sfdcarticles/Inventor-is-crashing-when-GDI-Objects-reaches-10000.html but a design I have tested is small (6-7 parts)

--------------- START VB CODE ---------------
Dim pdfAddIn As ApplicationAddIn = ThisServer.ApplicationAddIns.ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
Dim transContext As TranslationContext = ThisServer.TransientObjects.CreateTranslationContext
transContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
Dim optionsMap As NameValueMap = ThisServer.TransientObjects.CreateNameValueMap
Dim dm As DataMedium = ThisServer.TransientObjects.CreateDataMedium
optionsMap.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets
dm.FileName = System.IO.Path.Combine(fullPath, fileName)

pdfAddIn.SaveCopyAs(drawingDoc, transContext, optionsMap, dm)
--------------- END VB CODE ---------------

--------------- SIMPLIFIED LOG after SaveCopyAs---------------
[07/22/2024 16:53:57]     InventorCoreConsole.exe Information: 0 : Available Physical Memory (MiB) 11676
[07/22/2024 16:53:57]     InventorCoreConsole.exe Information: 0 : Total Memory (MiB) 16025
[07/22/2024 16:53:57]     InventorCoreConsole.exe Information: 0 : Free (%) 72.861154446177847113884555380
[07/22/2024 16:53:57]     InventorCoreConsole.exe Information: 0 : Occupied (%) 27.138845553822152886115444620
[07/22/2024 16:53:57]     InventorCoreConsole.exe Information: 0 : Disk Usage: 454 (MiB).
[07/22/2024 16:53:57]     InventorCoreConsole.exe Information: 0 : Elapsed Milliseconds: 120362
[07/22/2024 16:54:02]     InventorCoreConsole.exe Information: 0 : Available Physical Memory (MiB) 11678
[07/22/2024 16:54:02]     InventorCoreConsole.exe Information: 0 : Total Memory (MiB) 16025
[07/22/2024 16:54:02]     InventorCoreConsole.exe Information: 0 : Free (%) 72.873634945397815912636505460
[07/22/2024 16:54:02]     InventorCoreConsole.exe Information: 0 : Occupied (%) 27.126365054602184087363494540
[07/22/2024 16:54:02]     InventorCoreConsole.exe Information: 0 : Disk Usage: 454 (MiB).
[07/22/2024 16:54:05] End Inventor Core Engine standard output dump.
[07/22/2024 16:54:05] Error: InventorCoreConsole.exe found crash.
[07/22/2024 16:54:05] Error: Reading DUMP file:
[07/22/2024 16:54:05] Error: 2024-07-22 16:54:03 GDI_Objects 52  USEROBJECTS 10  GDIOBJECTSPEAK 61  USEROBJECTSPEAK 11 | SVxApp::CareForAllExceptions() (SVxApp.cpp L2918): |SEH exception caught while executing request!
stack = _NA_    _NA_    [NULL]  
_NA_    UTxCERLog::LogCallStack [NULL]  
_NA_    SVxApp::CanMigrateCustomSettings [NULL] 
_NA_    VBAxApp::TerminateVBA [NULL]    
_NA_    _C_specific_handler [NULL]  
_NA_    _chkstk [NULL]  
_NA_    RtlWalkFrameChain [NULL]    
_NA_    KiUserExceptionDispatcher [NULL]    
_NA_    _NA_    [NULL]  
_NA_    DWFOutExtensionInterface [NULL] 
_NA_    DWFOutExtensionInterface [NULL] 
_NA_    DWFOutExtensionInterface [NULL] 
_NA_    TranslatorExtensionGetExtensionInterface [NULL] 
_NA_    TranslatorExtensionGetExtensionInterface [NULL] 
_NA_    TranslatorExtensionGetExtensionInterface [NULL] 
_NA_    WT_OpcResourceSerializer::WT_OpcResourceSerializer [NULL]   
_NA_    DWFOutExtensionInterface [NULL] 
_NA_    DWFOutExtensionInterface [NULL] 
_NA_    DWFOutExtensionInterface [NULL] 
_NA_    TranslatorExtensionGetExtensionInterface [NULL] 
_NA_    FWxChangeRequest::Execute [NULL]    
_NA_    SVxApp::Destruct [NULL] 
_NA_    SVxApp::TranscriptingOn [NULL]  
_NA_    SVxApp::ProcessChangeRequest [NULL] 
_NA_    FWxSceneDoc::ProcessChangeRequest [NULL]    
_NA_    DWFOutExtensionInterface [NULL] 
_NA_    DllGetClassObject [NULL]    
_NA_    DllGetClassObject [NULL]    
_NA_    SetErrorInfo [NULL] 
_NA_    DispCallFunc [NULL] 
_NA_    VarNumFromParseNum [NULL]   
_NA_    RxDispatch::Invoke [NULL]   
_NA_    DllGetClassObject [NULL]    
_NA_    TranslateSecurityAttributes [NULL]  
_NA_    TranslateSecurityAttributes [NULL]  
_NA_    TranslateSecurityAttributes [NULL]  
_NA_    TranslateSecurityAttributes [NULL]  
_NA_    _NA_    [NULL]  
_NA_    _NA_    [NULL]  
_NA_    _NA_    [NULL]  
_NA_    _NA_    [NULL]  
_NA_    _NA_    [NULL]  
_NA_    _NA_    [NULL]  
_NA_    _NA_    [NULL]  
_NA_    LegacyNGenTryEnumerateFusionCache [NULL]    
_NA_    _NA_    [NULL]  

2024-07-22 16:54:04 GDI_Objects 52  USEROBJECTS 10  GDIOBJECTSPEAK 61  USEROBJECTSPEAK 11 | DumpAndSend() (ErrorReporter.cpp L1489): |Inventor Crash log!
[07/22/2024 16:54:05] Error: API method TranslatorAddIn.SaveCopyAs called by Add-in Translator: PDF caught an unhandled exception.
Memory may have been left in an inconsistent state.
[07/22/2024 16:54:05] Error: API method caught an unhandled exception.  Memory may have been left in an inconsistent state.
[07/22/2024 16:54:05] End script phase.

I have tested Inventor 2020, 2022, 2024 on my desktop and those work just fine. Inventor 2022 and 2024 on APS cause the error above. I have tested 4 production builds of my automation on APS over the past 2 years and they all cause the error above.


Solution

  • We recently deployed a patch for the 2024 and 2025 engines on Design Automation that hopefully solves this issue for others as well.