- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Adam - i think i am experiencing the same issue.
I am putting a Thread.Sleep(36 seconds or more) in my c# code after any COM call to the following Inventor methods in order to avoid moving on to the next api call too quickly...
- myAssembly.Update()
- myAssembly.Save()
- myAssembly.Close()
- InventorApp.Quit()
(that's not an exhaustive list btw, it's just the ones i have currently noticed and am troubleshooting)
The Thread.Sleep() is not required for assemblies less than about say 500 parts - but where we get the COM errors is when our assemblies are typically 1000 to 5000 parts. In my case, we are not using Vault and all our parts are created in Inventor 2016 - and so we do not have the underlying issue of badly migrated parts that the OP had.
So it seems to me that our c# code moves on to the next call even though Inventor is still actually busy finishing the .Save() the .Close() or the .Update() methods.
I really don't like the vulnerability of the Thread.Sleep() workaround. How long a sleep is enough?? - depends on the assembly!
So I shall follow your advice above and try to swap out our API calls above for the equivalent command and call the command with the Execute2() method as you advise. I will report back if this is successful.
However, is this as issue that can be properly addressed by Autodesk so that the vulnerability in the API is removed in future releases?
Please advise
regards
Dan
Atkins Consultants Ltd UK
+19,000 staff (M&E, Civils, Structural, Geotechnical, Environmental and more)