For and While Loops

#1

Can anyone tell me why I get no results for these two scripts…

#2

@BIMused

image

#3

@BIMused Also read the following , item #6

2 Likes
#4

As Salvo wrote, you forgot to return the list:

Here is a reference guide:

2 Likes
#5

Thanks Salvo!

1 Like
#6

Thanks for that, I starting working through this guide…

http://designscript.io/DesignScript_user_manual_0.1.pdf

…I guess it’s a little dated?

#7

Haha, yeah, that one is version 0.1 while DesignScript has evolved to 2.1, just skimmed over it but won’t continue using it, as there are some outdated stuff like using curly braces for lists instead of square ones. There are many updated resources like the one Salvo posted or Dynamo Primer:

https://primer.dynamobim.org/en/07_Code-Block/7-2_Design-Script-syntax.html

2 Likes
#8

https://dynamobim.org/wp-content/links/DesignScriptGuide.pdf should be updated for 2.1

2 Likes
#9

@architectcoding

Useful to work through to see how I can get the examples to run, here’s another one that has me stumped…

image

…no return?

#10

ok I fixed it here…

image

…so not sure why I can’t explicitly define p as a point type variable?

#11

thats a bug in imperative blocks, we have this tracked internally.

3 Likes