- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
In any other situation, where you are about to access the ComponentOccurrence.Definition property, you usually need to filter out any that are suppressed first using something like:
If occ.Suppressed Then Continue For
...where 'Continue For' is used to skip to the next item in a loop (if used within a loop), or use 'Exit Sub' if just inside a custom Sub routine just for that component. However, given what the code in this situation is trying to achieve, that may not work as intended. You are trying to access the Part Number iProperty of that component, which is normally not going to be possible while it is suppressed, making this a challenging request to fulfill. I'm guessing that you may be able to avoid using these lines of code, due to the inherent problem mentioned.
Dim doc As Document = occ.Definition.Document
Dim partNumber As String = doc.PropertySets("{32853F0F-3444-11D1-9E93-0060B03C1CA6}")("Part Number").Value
...and instead try using the iLogic shortcut snippet:
Dim partNumber As String = iProperties.Value(occ.Name, "Project", "Part Number")
But I still do not recall if that will work if that component is suppressed. It's worth a try though.
Wesley Crihfield
(Not an Autodesk Employee)