Filter rebar by shape

Hi All. Ive got a fairly easy code but The get parameter Im still trying to wrap my head around. I need it to select only bars of shape LL. Now its not doing anything.

Hi,

I’d have a look at the output of your ‘get parameter node’…

I’m guessing the output will say “LL” but it’s worth checking.

My suspicion would be that the LL is actually a Family Type, whereas you are checking for a String with your Equality test.

There is an ‘Object Type’ node in Dynamo that lets you check what sort of data is coming out of a node… If you plug that in and it says “String” then you’ll know you can check for it, if it says “Type” then you can add a “String from Object” node to convert the data into a Type which will work with your Equality test.

Hope that helps,

Mark

1 Like

so is there a way to filter by family type and not parameter? I just want to filter the list so it only displays bars of shape LL

Hello, put a watch at the output of your ElementgetValueByname node

Cordially
christian.stan

see below

Try plugging in like this to see what type of data to send to it

Cordially
christian.stan

Once you have the Family Type, you can get it’s Name value and test that? :slight_smile:

1 Like

giving errors

well the family type is LL. But how do I get it to select just the rebar of type LL? , I just dont know the correct node or syntax for it. In the project its listed as a parameter
image

Put x[0]
we must know the type of parameter 59 (I would go for a number 1 2 3)

Cordially
christian.stan

thats what Im doing and its giving errors

I’m blocking, sorry I can’t do more

Cordially
christian.stan

Look at the parameters available after pulling the shape parameter - those Element Types will expose the LL value if you ask them for the right info.

Cordially
christian.stan

1 Like

Almost there. The problem now is it is not selecting multiple rebars. It only selects one

Hello
CodeBlock

Val;
GL;
KL;
a=KL.Name==Val?1:0;
Rep=DSCore.List.IndexOf(a,1);
GL[Rep];

I’m on phone

edit:


This should answer
Best wishes

Cordially
Christian.stan