HRESULT 0x80004005 (E_FAIL) when running iLogic rule on BeforeSave event

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a rule that used to work just fine in Inventor 2017 Professionnal that no longer works in Inventor 2019 & Inventor 2020.
The rule code is the following:
Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition oAsmCompDef.RepresentationsManager.LevelOfDetailRepresentations.Item("SUPPRESS_INVISIBLE_ITEMS").Activate(True)
I tested this with attached Assembly2.iam file, when hitting the save button I get the following error:
Error in rule: Rule1, in document: Assembly2.iam
Erreur non spécifiée (Exception from HRESULT: 0x80004005 (E_FAIL))
Stack trace:
System.Runtime.InteropServices.COMException (0x80004005): Erreur non spécifiée (Exception from HRESULT: 0x80004005 (E_FAIL))
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at Inventor.LevelOfDetailRepresentation.Activate(Boolean SkipDocumentSave)
at ThisRule.Main()
at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)
This is an upgrade error from 2017 to 2019, so I would expect to get support from Autodesk.