Node to DesignScript


#1

What’s the best way to figure the designscript equivalent of a node?


#2

Just hover over the node


#3

Vikram, Thanks for the quick reply. This does not necessarily apply to all nodes. List.Map and Geometry.Explode for example are a couple that I can’t get to work…


#4

You can also download the latest daily build and check out node to code. :lol:


#5

How to check node to code?


#6

Daily builds after 0.81 have it as an option. Just select your nodes, right click on the canvas and choose “Node to Code”. Unfortunately List.Map isn’t supported at this moment. Tho you can search the forum for some examples on how to use it in DS:

http://dynamobim.com/forums/topic/transforming-a-list-map-function-into-a-code-block/

I just tried using the “Node to Code” functionality with the Geometry.Explode and it worked wonderfully:

2015-06-26_10-04-21

2015-06-26_10-03-34


#7

The List.Map functionality (and more) can be achieved in Design Script by defining functions.

However, one thing that probably still isn’t possible is - specifying a function as a key (like in SortByKey) within the script.


#8

Map node to Script

20150625-1


#9

Is there a way to use the List.Map node to go into more than one sublist level?

In your previous example, you use it to get all items of index “2” in all sub-lists. Where the node assumes you mean to search only one sublist level down

What if you have a further sublist level?

Is it possible to extract items of index “x” at a specific sublist level?

 
Capture


#10


#11

The previous post example with List.Count should help explain the concept better than the below example using List.GetItemAtIndex


#12

Thank you, that is super helpful. I guess I don’t really understand list management and List.Map in particular. In fact, I found your designscript definition much more clear.

As a follow up, I am also puzzled by how these 2 definitions (attached) behave. Especially how the Curve.EndPoint and Curve.PointAtParameter differ in their behavior. I expected them to behave the same way. Would you help illuminate why they act like that?

Capture


#13

Alex - the use of curly braces at the beginning of each of your examples structure the sub lists differently. Different input structures are giving you different results.

20150629-4