
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Inventor 2013 Add In code written in C#
I have managed to extract the "new" TitleBlockDefinition from my source drawing. (tblock)
I am trying to replace the title block definition in my active drawing with the "new" one.
Note. Both definitions have the same name, the only difference is that the logo has changed.
// I tried
DrawingDocument curDwg = (DrawingDocument)InvApp.ActiveDocument;
TitleBlockDefinition updatedTblock = tblock.CopyTo(curDwg, true);
This fails to compile because for some reason the CopyTo function expects a "_DrawingDocument" reference instead of the expected "DrawingDocument".
So I redefine curDwg to a _DrawingDocument and try again. This time the code compiles but unfortunately produces an error. Worse yet the error is vague.
System.Runtime.InteropServices.COMException (0x80004005): Unspecified error
(Exception from HRESULT:00x80004005 (E_FAIL))
Any ideas? The code for replacing a title block is in the Inventor API help file, however in VB not C#.
Solved! Go to Solution.