Replacing family type by parameter values using lists

As posted previously I am working on creating line based detail items at the location of wall openings, in order to visually show in floor plan views where there are walls above an opening.

Now, the final step is to set the type of the family instances of this line based detail item according to the type mark of the wall it is ‘part’ of. Why? because the color of the different wall types are set by a v/g filter override for the type mark parameter and I want the detail items to be ‘overwritten’ accordingly (these types have the same type mark as the walls)

I am still struggling a bit with using lists, however.

1 list containing all the family types of the line based detail item. Type name: W00_placeholder and W01 through W44.
2 list contains the created line based elements, sorted per wall.
3 list shows the type mark of the walls, sorted per line based detail item.

Now, I want to be able to combine list 1 and 3. Something like: W01 (type mark) of list 3 should be filled with “family type W01”, etc. resulting in list 4

Then, I want the elements in list 2 to be replaced by this new list (4), maybe using FamilyInstace.SetType?

I hope my question is clear enough, if needed I can elaborate of course! Thanks.

 

Since you already have an equivalent detail type for each wall type, it would be very easy to sort them similarly and build a dictionary. Finally map each sub-list of wall types to the dictionary and get the correct detail types and use that to change types:

Hi Dimitar,

I have no idea what a dictionary is or what it does, so I have some homework to do :slight_smile: Thank your for your suggestion though, I will certainly look into to it! In the mean time, I was lucky enough that my wall’s Type Mark and detail item’s Type Mark had identical values. This way I was able to reuse the Wall Type Mark list as input for the FamilyType.ByName node, as the family type names of my detail line happened to have the exact same name (was the same string so to speak). Not the prettiest solution and kind of cheating, but in my future workflow it works like a charm :wink: