Nodes into code block

Hello, I’m beginner in Dynamo and I created a rather long code. I would like to move the nodes into code blocks. I often get this kind of error. Everything works in one place and don’t work in another. I don’t understand why, can you help me?

@glodwajz , hi

Whats the aim of your exercise ? Block to code is practical when later on people use it in player, because every input in a block is not accessable via DPlayerInterface. some shortcuts via designscript are very handy…

KR

Andreas

@Draxl_Andreas Hi, thanks for your reply.
The aim is to practice new coding techniques. Dynamo it’s a new hobby after work :grinning:

As far as I understand the problem is that DSCore is added to the input and I don’t know how to avoid it.

Count(x);  //input Elements
List.Shuffle(x);
0..Count(x);
x.Parameters[0];
x.Faces;
x.Area; // get area of a surface
x+""; //convert to string
x+0.0; // convert Int to Double
x.Name; //get Type Name
x[23];v//Index at
x[0][3]; // get item in list of a list

a.s.o

Operators:

x == y;
x != y;

a.s.o.

1 Like

Did you use Node to Code to get the code block? That’s always the best place to start.

If you start typing out the main method you should get intellisense suggestions (most of the time) for the specific namespace if it’s needed. You typically only need to go back as far as necessary if you have DLLs with duplicate libraries. This is why your previous code block has some methods called with the main namespace and others back to DSCore. You likely have other packages with List and String namespaces, so you have to specify the core Dynamo versions.