- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
I am making a drawing of an iForm part and am trying to get inventor to automatically make some of the dimensions. I follow this tutorial:
https://www.youtube.com/watch?v=bcOvYc6rNUk
However, when I insert the code marked in red below, I this error:
Error in rule:
Unable to cast COM object of type 'System.__ComObject' to interface type 'Inventor.AssemblyDocument'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{29F0D465-C114-11D2-B77F-0060B0F159EF}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
I have no clue why I get this error message.
Code:
'---INITIAL SETUP---
'References this document
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisDoc.Document
'References this drawing sheet
Dim oSheet As Sheet
oSheet = oDrawDoc.ActiveSheet
'References this drawing view
Dim oView As DrawingView
oView = ActiveSheet.View("1").View
'References this drawing view model
Dim oAssyDoc As AssemblyDocument
oAssyDoc = ActiveSheet.View("1").ModelDocument
'Readies code for creation of reference points for dimension placement
Dim oTG As TransientGeometry
oTG = ThisApplication.TransientGeometry
'Readies code for creation of general dimensions
Dim oGeneralDims As GeneralDimensions
oGeneralDims = oSheet.DrawingDimensions.GeneralDimensions
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report