Duplicate data in representationElements collection

By setting up a small PCBD:
It seems that the returned size of the requirement collection provides duplicated items.

selection.target.representationByDescriptionName('Physical Component Breakdown').representationElements.target->filter(Requirements::Requirement)->size()

I doubt there’s a capella / eclipse implementation issue, but I try to figure out from where it’s coming. Is this link to some visibility parameters?


Your expression will retrieve all representation PCBD on the given element and then list all represented elements for each of them. My guess is you have another diagram PCBD for this object. Also a semantic element can be represented several times on a diagram. You can use ->asOrderedSet() to remove duplicates.

1 Like