I can't select the level of an object

My goal is to be able to number doors automatically in relation to their x and y strings and their level but I’m totally stuck on the level! I can’t get them out (nothing is displayed) I use categories(level)>all element of categories >get parameter value by name which I connect to "string "level but nothing comes out, the list is empty, I started dynamo a little while ago and I’m breaking my head on this subject, thanks for your feedback. :slight_smile:

My dynamo and my revit are in french here is my screenshot.

When you say that you want to get the “level” what information from the level do you want?

At the minute you are trying to get the value “level” from a list of levels. If you want the levels elevation (eg. +10.00m) then use the node level.elevation.

Explore the node explorer and look at list of options available for levels. There are lots of nodes for them.

If you cant find what you are looking for in the existing nodes, try using the element.parameters node to see all of the parameters available to you from levels.

The reason the element.getparametervaluebyname node is returning nothing is because the level elements have no parameter called “Niveau”.

Hope that helps

2 Likes

my goal is to have the dynamo annotate the doors according to the ground floor level 001,002… R+1 101,102 ect I therefore need to recover all the levels of the project and in relation to my revit template keep only the levels with the diminutive “FINI” if I take values like 10m it will not be able to adapt to this situation. I’d like it to be coded with 101,102 if the door is on R+1… am I wrong?

You are neither right nor wrong, the data you wish to extract and how to use it is up to you! I’m simply trying to understand what you want to achieve and how to achieve it :slight_smile: .

By the sounds of it, you want the level’s name (assuming you have levels called 00, 01, 02…).

Simply get the level’s name using ‘level.name’ node. Then use this as part of the constructor for your door number.

I think I’m getting lost myself in my dynamo code, I’ve been using it for a while now, I’m trying to find the levels where “FINI” is indicated to associate them with the door later on. To sum up my objective in full: “I want to create a dynamo that will number the doors (which I could then use for windows or other in the same format) of my project revit part floor for the ground floor 001,002 ect for level 1 101,102 ect (in my gabaris revit the levels are called “RDC_FINI” ; “R+1_FINI” ; R+2_FINI ect ) and so that I can see them written out like in a book, starting at the top left and working down to the bottom right, recovering the x and y coordinates”. This dynamo script would save me time on my revit projects, but unfortunately the level thing is blocking me.

Most of what you’re doing is just extra work. Just search for the capitalized string “FINI” since that’s your current standard and then filter the elements.

Thank you for analyzing my work and helping me, if I’ve added all these “useless” nodes it’s because they don’t locate the word “FINI” without really knowing why, so I’ve tested a lot of things without success. Here’s a concrete example all resort to “false” when it’s clear that FINI is well written.

Your inputs are plugged in the wrong way round

2 Likes

Bahahahahaha i looked at this, tested how it should work on my side… Worked on my side and then got confused and thought i’d throw a bit of python at it…

So well because thats done i may as well put it here uselessly…

Useless Python Script
# Made by >         pyXam
# Dynamo Forum >    https://forum.dynamobim.com/u/pyxam

# Define the Python function to check the strings
def check_strings(input_data):
    # If the input_data is a string, convert it into a list of items
    if isinstance(input_data, str):
        items_list = input_data.split(",")  # You can also use input_data.split() if items are space-separated
    # If the input_data is already a list, use it directly
    elif isinstance(input_data, list):
        items_list = input_data
    else:
        raise ValueError("Input data must be either a string or a list of strings.")

    # Initialize an empty list to store the boolean results
    results = []

    # Loop through each item in the list and check if it contains "FINI"
    for item in items_list:
        if IN[1] in item:
            results.append(True)
        else:
            results.append(False)

    # Return the list of boolean results
    return results

# Data input into the Python Script node through the IN variable (modify this as needed)
input_data = IN[0]

# Call the function with the input data and get the result
result = check_strings(input_data)

# Output the result using the 'OUT' variable for use within the Revit Python Script node
OUT = result
2 Likes

:sweat_smile: :rofl:

I nearly didnt spot it…

thank you very much, the solution was so simple… :smiling_face_with_tear: