I am writing application in .NET. I have a problem with .Documents.Open(filePath). Inventor crashes with this message in log (dump included):
<Exception code="0xC0000005" text="ACCESS_VIOLATION" address="0x000000006C666ADF" extraInfo="module:C:\Windows\system32\MSVCR100.dll ">
<AccessViolation type="Read" address="0x0000000000000000" PGStatus="0x00000001" accessing_null_ptr="true"/>
During opening I resolve unresolved links using OnFileResolution event for files saved in different location in Vault. This error randomly occurs in 60% assy parts.
Solved! Go to Solution.
Solved by p.rybar. Go to Solution.
I am actually .NET beginner, in debug mode the code terminates during Document.Open, after Inventor crashes with access violation error. I do not know how to debug inside Document.Open method.
This might also be a memory problem, If you are using a Standalone application kill the Inventor process after processing few documents and initialize a new Inventor session.
Such kinds of error needs a proper case or scenario, or else we will be working on Gut feeling or wild guess.
Give a try using Documents.OpenWithOptions
Thank you for advise. OpenWithOptions does not solve the problem. I use standalone app, so it might be a memory problem, bud I need a solution. If I kill process after each lauch my script will be too slow and often this error shows even when starting from new Inventor instance. Is there some multithreading template ho run Inventor?
What do you mean by proper case or scenario?
yes there will be a performance hit.
Basically the Inventor API is not multi threaded, so there is little advantage to write a multi-threaded application if several threads are going to perform API calls. What will happen is that each call will be queued by the COM server and processed sequentially. You can however have a multi-theaded application where a single thread access the Inventor API and other threads perform custom logic, either by using the data stored by the Inventor thread, access your custom database and so on...
(Reply from ADN Support Specialist From another post)
And by proper case or scenario i meant, the cause of this issue. And also i hope you are using Try....Catch blocks
Yes, I use Try Catch :),
The error ocurs during Document.Open (Inventor Call), when Inventor crashes. I am not experienced enough to read some information from Inventor dump file to recover the specific reason of the crash.
Thanks for multi threading post - but I am rather looking for some working example.
My task is to perform some tasks on 80000 files (iam, ipt, idw) saved in Vault:
1/ Download file and its children
2/ Open in Inventor -> Crash
3/ Perform task (check/restore properties, export pdf)
4/ Close Inventor
5/ Check-in to Vault
6/ Generate report
Do some tests. On the files that crash try manually doing the process. Check the state of the files. Are they read only, an older version of Inventor files, a newer version, copied completely before opening, all dependent files accessible, setup for a different project, etc...
It may not be an api problem but could be a file i/o problem. Or just a corrupt file.
I finally found the error. It occurs in file resolution of references, which were renamed inside Vault. I hope to find procedure how to load such files into Inventor.