Get curtainwall element by curtaingridline

Hi there,
I’m working on a script which shall retrieve some informations by curtain panels.
I need to start by a dimension placed by user and I’m trying to retrieve a CurtainWall from the CurtainGridLine which were picked by user (which acts in the dimension as ReferencedElements)when placed the dimension.


I looked into the RevitAPIs but didn’t find a property or a method to get the host element (the CurtainWall element indeed) to which CurtainGridLines refers to.

At the moment I’m going the long way around by getting all curtain panels and get the intersection to such CurtainGridLines, filtering and retrieving the parameters I want but I feel there must be a more direct way.
Do you have any hint?

Thanks in advance
P

@paolo.pozzoli ,

you can use ObjectType and groupByKey

Hi @Draxl_Andreas , sorry but I don’t get your suggestion.
What I shown in the image is just the focus I’m getting from the user drawn dimension.
As I said, I shall retrieve the curtain wall to which the curtaingridlines refers to.
How can I get the curtain wall by curtain grid lines?

Now as we speak I’m thinking about a different approach: get all curtain walls, get their curtaingrid.vgrids, check their ids agains the cutaingridlines I obtained by the dimension and filter them.
This may be a slightly better solution than my previous one.
Gotta test it.

EDIT: your graph is much easier to understand. I’ll try and get back to you. Thanks

Hi @paolo.pozzoli & @Draxl_Andreas ,

Building on Andreas’ idea: Perhaps List.RemoveIfNot would be even better instead of the List.GroupByKey