ID from a list


#1

Hello,
I would like to know if it’s possible to take the ID of the elements from a list (the list is shown in the image below). Is it also possible to take only the ID of the elements counted as “false”?


#2

Hi :slight_smile:

Try the Element.Id node.

Try playing with List.FilterByBoolMask to filter those element first, then query their IDs with Element.Id


#3

Thanks for your reply. I’ve probably solved with this but I got an error message (Waring: Asked to convert non-convertible types). Do you know why?


#4

You’re passing a parameter value to Element.Name, not a an element.


#5

I was doing the same also before and it was working properly. If i pass from Element.GetParameterValueByName directly to the input of == function, the script gives me wrong results (everything is correct).


#6

Really hard to tell without all the previews of the nodes activated…

We could be speaking about bananas or strawberries, I’ll have no clue of it.


#7

You are right.
Here the two different scenarios.
In the first case I’m using Element.name between the Element.GetParameterValueByName and the == function: the results I got are reliable. In the second case I’m not using Element.name between the Element.GetParameterValueByName and the == function, but I’ve linked them together directly: the results I got are not reliable.
I know for sure that my result should be 12 correct and 1 wrong.
Any suggestion?


#8

I think you did not get my previous message :slight_smile:

2018-11-26%2016_09_44-Dynamo 2018-11-26%2016_09_52-Dynamo 2018-11-26%2016_10_01-Dynamo

Otherwise, we cannot know where the error may be.


#9


#11

Use a “Phases” node in lieu of the code block before the “=” node. This will compare the Phase element not the Name/String of the phase.


#12

The problem is cercled in red. One of the parameters of your walls is not correctly informed : it should be a Phase but it is a string. If you want to delete the error, you should correct this directly in the model.
You could also filter those elements using the Object.Type node, but i’d recommend correcting the model.


#13

It makes sense but it doesn’t work as shown in the figure below. I know that I have 12 elements on the phase “stato di fatto” and 1 on the phase “stato di progetto”.


#14

Try using the Object A = Object B node in lieu of == since you are comparing elements. But that still doesn’t resolve why there is an element not on a proper phase per the response from @mellouze.


#15

I can see that it seems like if Dynamo doesn’t recognize the phase “Stato di Progetto”, but as you can see from the pictures below, I think that the model is correct.


#16

Thanks for helping me. Where can I find this Object A = Object B node? Anyway, as you can see from the picture I’ve uploaded under the Mellouze’s reply, I cannot understand if there is an error in the model… in my opinion the model is correct


#17

See my image above. This is a built-in node actually called “Equals”.


#18

I’ve tryed, but it doesn’t work again


#19

Have you tried to adjust the lacing? You may want to try “longest” to see if that give you the results you need.

May I ask what Dynamo version and Revit version you are using?


#20

Lacing appears to work differently in Dynamo 2.0 and that works to resolve it for me.


#22

Now it works! Thanks a lot Sean. Even if this problem is solved, I cannot solved the problem with the phase “Stato di Progetto”. Dynamo doesn’t recognize it as a phase, but I really don’t understand why.
Anyway, thanks again for helping me