- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I am attempting to collapse all Model Browser Nodes with the exception of the Representations that will be expanded. I am looking for help as the code errors on "oNode.Expanded". Thanks in advance.
Dim oApp As Inventor.Application oApp = ThisApplication Dim oDoc As Document oDoc = oApp.ActiveDocument Dim oComDef As ComponentDefinition oCompDef = oDoc.ComponentDefinition Dim oRepMan As RepresentationsManager oRepMan = oCompDef.RepresentationsManager Dim oDVReps As DesignViewRepresentations oDVReps = oRepMan.DesignViewRepresentations Dim oPanes As BrowserPanes oPanes = oDoc.BrowserPanes Dim oPane As BrowserPane oPane = oPanes.Item("Model") Dim oTopNodes As BrowserNode oTopNode = oPane.TopNode Dim oNodes As BrowserNodesEnumerator oNodes = oTopNode.BrowserNodes For Each oDVRep As DesignViewRepresentation In oDVReps oDVRep.Activate For Each oNode In oNodes If oNode.FullPath.Contains("Representations") Logger.Info(oNode.FullPath) Logger.Info(oNode.Expanded ) oNode.Expanded = True oNode.BrowserNodes.Item(1).Expanded = True Else oNode.Expanded = False End If Next Next
Error:
System.Runtime.InteropServices.COMException (0x80004005): Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateSet(Object o, Type& objType, String name, Object[] args, String[] paramnames, Boolean OptimisticSet, CallType UseCallType)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateSet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean OptimisticSet, Boolean RValueBase, CallType CallType)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateSet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments)
at ThisRule.Main() in rule: Rule1, in document XX-XXXX-T_Diverter_Template.iam:line 37
at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)
Solved! Go to Solution.