Simplifying floor level


#1

I am trying to collect the Level from all floors in my model. The Clockwork node Element.Level accomplishes almost exactly what I need except that I only want “LEVEL 1”, “LEVEL 2”, etc.

 

I have made many attempts to strip away parts of the string and isolate “LEVEL X”…

  1. use String.Split to break the list from Element.Level into 3 sublists: Level, Name=LE VEL X, Elevation=X (image: Watch 1)

  2. use String.Remove to eliminate the first 5 characters in each sublist, thus isolating LEVEL X on line [1] (image: Watch 2)

  3. use List.FilterByBoolMask to filter out only sublist items that contain "LEVEL " (image: Watch 3)

…even after all these steps, I still get several “Empty List” values because one of the Levels is named MEZZANINE (image: Watch 4)

 

I am hoping someone has a simple solution? Here are 4 workarounds that might work:

  1. edit the Element.Level Python script from the Clockwork node to only collect “LEVEL X”

  2. after the String.Split step, break each sublist into its own unique list OR somehow only extract line [1]

  3. feed more than one string into the “searchfor” port of the String.Contains node ("FLOOR " and “MEZZANINE”) to ultimately filter TWO criteria using List.FilterByBoolMask

 

2_floor level def


#2

It sounds to me like “List.FilterByBoolMask” in combination with an “Element.Name” will do the trick.

 

See below.

 

2015-04-21_16h04_58

 


#3

John, thank you for the response. After trying out your approach, I still was left with a long string of level name information. However, after building upon the information this definition provided I was eventually able to refine the string down to just “LEVEL 1”, etc.

If anyone can recommend a way to simplify this process, I would love to hear it…

3_Level only


#4

Kyle, the name filter you have set up will not work like that - otherwise the correct level names should come out of the “in” output port of the List.FilterByBoolMask node, not the “out” output port. Also, everything behind that node is way too complicated - you can just use the filter to get a reduced list of level names. Here’s how:

FilterByLevelName


#5

I knew there had to be a simpler way… Thank you very much Andreas, this accomplishes EXACTLY what I was trying to achieve.