
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm getting an error with the sketchedsymbolslibrary object not iterating through the sketched symbol definitions that it has:
System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Inventor.SketchedSymbolDefinition'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{A907AED3-A78F-11D5-8DF8-0010B541CAA8}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
at TTSInventorTools.ClearanceDraw.CreateClearanceDrawing() in C:\Code\Inventor\TTS Inventor Tools\TTSInventorTools\TTSInventorTools\ClearanceDraw.vb:line 803
at TTSInventorTools.ClearanceDraw.CreateClearance() in C:\Code\Inventor\TTS Inventor Tools\TTSInventorTools\TTSInventorTools\ClearanceDraw.vb:line 142
The previous error is thrown on line Dim ssd as ... When I used a for each as method with defnition it errored out as well.
'insert target symbol into document Dim symLibs As SketchedSymbolDefinitionLibraries = ClearanceDrawing.SketchedSymbolDefinitions.SketchedSymbolDefinitionLibraries For Each symLib As SketchedSymbolDefinitionLibrary In symLibs If symLib.Name = "Clearance.idw" Then For i As Integer = 1 To symLib.SketchedSymbolDefinitions.Count Dim ssd As SketchedSymbolDefinition = symLib.SketchedSymbolDefinitions.Item(i) If ssd.Name = "TARGET" Then ClearanceDrawing.SketchedSymbolDefinitions.AddFromLibrary(symLib, ssd.Name) ElseIf ssd.Name = "AXLE LOAD RIGHT" Then ClearanceDrawing.SketchedSymbolDefinitions.AddFromLibrary(symLib, ssd.Name) ElseIf ssd.Name = "AXLE LOAD LEFT" Then ClearanceDrawing.SketchedSymbolDefinitions.AddFromLibrary(symLib, ssd.Name) End If Next End If Next
Please help to resolve, I would like to insert the sketched symbols from my definition library so I can place the symbols into my drawing document.
Thanks,
Solved! Go to Solution.