How to use to use if statment in a codeblock

Hello

How do i write this if statement in a codeblock and what node can I use instead of List.GetItemAtIndex so i dont get this error?

@Graesborg

syntax is

? :

what’s your condition?

Maybe something like that:

1 Like

Thanks it works.
Just to understand the code what does the “?” mean in the code?

@Graesborg see below

Please mark the post as solved

Tanks for the help :slight_smile:

@Graesborg not a problem.

You should not mark yours as a solution unless you figure it out yourself :wink:

1 Like

haha wrong button

use filter by boolean mask after the == node to remove away the warnings you are having now…

Thanks =)

Sorry to revive the post, however your help was the closest thing to helping me as well.
I tried using the same solution to create the following script; import cad link blocks and convert it into a revit family with the same name.
I’ve tried it in countless ways, and this time using the function; if the block name is the same as the tal family, import it in the same position.
What could I be doing wrong?
Thanks a lot in advance

The original if statement is doing a math test for results. Looks like you are trying to do a string match test, so you will need to use different logic (as shown below). Can’t really see your inputs that well, please zoom in to that part of your graph, if the below doesn’t resolve your issue.

image

Thanks for the help and attention. However it still didn’t work. If you could review my file, I would greatly appreciate it.
You see, another routine beside it works, however it works with the position number of the block name in the code block, and it couldn’t be this way, because, when I import another plant and the points change position, it imports the wrong families .
It has to be something like that, by name, example; block name such will be family such (with the same name).
8º - Automação.dyn (99.8 KB)

You had the coding incorrect. Should be a == b as shown in the bottom code block. If this still does not give you what you want, then you may want to start a new post so everyone else will provide input.