Visual Studio.net Code Causing Inventor Crash

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I have written a standalone application that uses the API to replace the title block in an open Inventor drawing with one defined in one of our standard drawing templates. I am having an issue with Inventor crashing during a certain block of code, which I've pinpointed below:
oSourceTitleBlockDef = oTemplate.ActiveSheet.TitleBlock.Definition
oNewTitleBlockDef = oSourceTitleBlockDef.CopyTo(odrawdoc, True)
oNewTitleBlockDef.Name = "Name"
oSheet.TitleBlock.Delete()
Call oSheet.AddTitleBlock(oNewTitleBlockDef)
Where oTemplate is the template drawing which I've called to open previously in the code:
oTemplate = ThisApplication.Documents.Open(FilePath, False)
The sheets in which this has occurred have all had existing title blocks. It is a very infrequent error, which has made troubleshooting it very difficult. I can run this code hundreds of times without any issues, and if I do have a drawing which causes the crash, the next time I try this code on the same drawing there will be no issues.
The dump file for the crash shows the following:
Thanks in advance for any suggestions!