Error in Imperative?

I was studying conditional statements in the design and script were a fundamental error.

thank you very much.

I don’t think it makes sense to use replication guides inside the imperative block…

1 Like

Can you suggest another way that I can implement this idea? :slight_smile:

You need a nested loop, for instance like this:

[Imperative]
{
	a = 1..3;
	b = 1..5;
	out = {};
	for (i in a)
		{
		for (j in b)
			{
			out[i-1][j-1] = Point.ByCoordinates(i,j,0);
			}
		}
	return = out;
};
3 Likes

Thank you for this suggestion I would have developed it to solve the problem :smiley:
This is one way I solve problems with the dynamo button:


You can use if in a code block with the following syntax: (without imperative block)

test ? true : false

You can define an Associative block inside an Imperative block.

5 Likes

This is really new and helpful to me. Thank you for letting me know this. :grinning:

a<10?(Point.ByCoordinates((1…3)<1>,(1…5)<2>,0)):(Point.ByCoordinates(-1,-1,0));

I really like it. Thank you.:cười toe toét: