Check parameters of one element, and operate with another element

The question is:

Is it possible using nodes, to check, for example, value of property of element1, and, depending on its value, operate/change element 2 or its properties.


The IF node works not the way I need. It only returns given values, but I need to have different ways of working nodes.


The FilterByBoolMask node works nice, it separates on two ways, but it accepts element1 and continues to work with element1 after execution. But I need something to be able to work with another element.
:thinking:
Is it possible? Please, help.

what is the relation between the elements?
to build on this logic we need some more information

you can use code block for this:

[conditon]?[command to execute when true]:[command to execute when false];
x = 4;
y = 3;
x>y? x+2:x-1;

The point is that in my case its not necesary to have relation between elements. For example I have pipe and wall. If wall is made of concrete, i will move pipe left on 5 meters, if not, I will move to the right. So there is no logic between them, I want to create my own logic.

Seems like you got me, but for me it kinda new. I want to have list of elements to check some condition, if true, I want to execute some operation with another list of elements (different from the first list). Can you explain please, if it can be made by the code block?

like what @Marcel_Rijsmus said, maybe you can give an actual example of your concept and we can work from there. There is just too many uncertainty to give you a actual solution to work with or work around. There is multiple ways to do this depend on the list, type of loops, type of conditions etc etc etc. So please show us a specific idea on what you are trying to achieve and we can work from there.

Tried code block and got this.
This is one condition.

This is another condition.


As you can see I want to select different lists of elements by condition.

It works, but return only first element of list. How can i fix it?

do this instead

list1;
list2;
condition;
x = [Imperative]
{
	y = [];
	if (condition == true)
	{
		y = list1;
	}
	else
	{
		y = list2;
	}
	return = y;
};

python can achieve the exact same thing by the way

Very nice! Thank you very much, I know I could use Python, but I dont know it :sweat_smile:
I guess its time to start practice more on DesignScript! Thank you again!:+1:
PS designscript looks more familiar to me)

Cant understand what is wrong here. For what reasons it can be?

i dont understand your error language, mind translating to english?

my guess is you are using dynamo 1.3…

replace y=[]; to y={};

Yeeep, thats the problem, thanks a lot!