Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I started getting this error with an iLogic rule that had been working. Haven't knowingly changed anything.
Has anyone else had this happen and what is causing it? If so, how was it resolved?
Help would be much appreciated.
Unable to cast COM object of type 'System.__ComObject' to interface type 'Inventor.AssemblyComponentDefinition'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{AA044AA1-D685-11D3-B7A0-0060B0F159EF}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
Here is the rule
'set a reference to the assembly component definition. 'This assumes an assembly document is open. Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition 'define View rep Dim oPosRep As DesignViewRepresentation Dim sPosRep As String Dim MyArrayList As New ArrayList 'record the active view rep name Dim sActiveDesignViewRep As String sActiveDesignViewRep = oAsmCompDef.RepresentationsManager.ActiveDesignViewRepresentation.Name For Each oPosRep In oAsmCompDef.RepresentationsManager.DesignViewRepresentations MyArrayList.add(oPosRep.Name) Next sPosRep = InputListBox("Select from the list:", MyArrayList, sActivedesignviewRep, "View Rep Desired") If sPosRep = "*Add a new Positional Rep*" Then newPosRep = InputBox("Enter a name:", "iLogic", "New View Rep_" & iArrayList) newAngle = InputBox("Enter an Angle:", "iLogic", "5") 'create New pos rep oAsmCompDef.RepresentationsManager.DesignViewRepresentations.Add(newViewRep) myAngle = newAngle Else 'activate the selected View rep oAsmCompDef.RepresentationsManager.DesignViewRepresentations.Item(sPosRep).Activate End If
Solved! Go to Solution.