Message 1 of 14
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm working on an AddIn that turns off visibility when some criteria are matched. The issue I am having is that it just stops running after the first subassembly, no errors or warnings....
Any ideas?
For Each occ As ComponentOccurrence In assemblyDef.Occurrences
Try
Dim refDoc As AssemblyDocument
MsgBox("got into assemblies")
refDoc = occ.Definition.Document
MsgBox(occ.Name)
Dim customPropSet = refDoc.PropertySets.Item("Design Tracking Properties")
Dim SAPProp = customPropSet.Item("Stock Number")
Dim SAPVal = SAPProp.Value
'MsgBox(SAPVal)
If SAPVal <> Nothing And IsNumeric(SAPVal) Then
If (oData.ContainsKey(SAPVal) And oDataM.ContainsKey(SAPVal)) Then
If (oData(SAPVal) = oDataM(SAPVal)) Then
occ.Visible = False
Else
occ.Visible = True
estr.Add(CStr(SAPVal) & ": " & oData(SAPVal) & " <> " & oDataM(SAPVal))
End If
End If
End If
Catch Ex As Exception
MsgBox(Ex)
End Try
Solved! Go to Solution.