
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to change the BOM Structure of parts that are suppressed to reference using the code below, however I can not get it to function. Can any one help me out (Error message posted below the code)?
Dim doc As AssemblyDocument doc = ThisDoc.Document For Each oOcc In doc.ComponentDefinition.Occurrences If oOcc.Suppressed Then oOcc.BOMStructure = 51972 'reference Else oOcc.BOMStructure = 51969 'default End If Next
Error in rule: LNSJ20.580_BURNER_UNIT, in document: LEB248691.IAM
Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
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 LmiRuleScript.Sub9(Object oPane)
at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)
Solved! Go to Solution.