12-21-2021
04:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
12-21-2021
04:07 AM
Thanks for you reply! I did same assumption - iterate over ComponentDefinition.Occurrences.
Could you please help me to understand to this part of code?
.Cast(Of ComponentOccurrence).
Select(Function(occ) occ.ReferencedDocumentDescriptor.ReferencedDocument). Distinct().ToList()
Cast(), Select(), Distinct() and ToList() look like Enumerable Class methods.
- Cast is used here because if we are trying "to extract" items of ComponentDefinition.Occurrences but not using Item Property, it doesn't know about it's type?
- Select is using lambda function (for each item "extracted by Cast") which returns ReferencedDocumentDescriptor.ReferencedDocument?
- Distinct is there to "filter out duplicity"?
- ToList "packs" all these Documents into a List?
Inventor 2022, Windows 10 Pro
Sorry for bad English.