Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi there,
I am getting the below error When I am trying to run the Bend rule from assembly level through External Rules.
Unable to cast COM object of type 'System.__ComObject' to interface type 'Inventor.PartDocument'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{29F0D463-C114-11D2-B77F-0060B0F159EF}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
Running this rule on part level seems to be working wothout any error, this error occurs only when it is triggered from External Rule.
Bend Rule:
Dim oPartDoc As PartDocument oPartDoc = ThisApplication.ActiveDocument Dim oCompDef As SheetMetalComponentDefinition oCompDef = oPartDoc.ComponentDefinitions.Item(1) oBendCount = oCompDef.Bends.Count 'MsgBox("Bend Total: " & oBendCount) iProperties.Value("Custom", "No Of Bend") = oBendCount
External Rule:
'To run external rule for all sheet metal parts Dim aDoc As AssemblyDocument aDoc = ThisApplication.ActiveDocument Dim iDoc As Document For Each iDoc In aDoc.AllReferencedDocuments If iDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then auto = iLogicVb.Automation auto.RunExternalRule(iDoc, ”Bend”) iDoc.Close() End If Next iLogicVb.UpdateWhenDone = True
Solved! Go to Solution.