Page 1 of 1

connecting nodes without using a node manipulator

Posted: Monday 22 August, 2016 - 13:39
by jonas69
Hey guys,

I want to connect nodes by using 4DScript and without moving the node manipulator manually.

I’ve already used Node_Manipulator_t-connectnodes:


Do(
connect(0,AtomByName([Network Node1],Model),1,AtomByName([Node Manipulator3],Model)), {connecting a Node with the node manipulator by channel}
Node_Manipulator_t-connectnodes(AtomByName([Network Node2],Model),in(1,AtomByName([Node Manipulator3],Model)))
)



Unfortunately there was an error popping up:
“No atom currently selected: c (Node_Manipulator_t-connectnodes)”

I guess the commend Node_Manipulator_t-connectnodes has to be used as a function by a selected Node Manipulator (e.g. Node_Manipulator_t-connectnodes(in(1,c), vtp(CurrentAtom)))

Does someone know a way to solve this problem? Is there a chance to connect nodes without using a node manipulator?


Thanks!
Jonas

Re: connecting nodes without using a node manipulator

Posted: Tuesday 23 August, 2016 - 18:37
by HarryBunnik
Ha Jonas,

The problem is that the code as it is available in the Function: "Node_Manipulator_t-connectnodes" is designed with the idea that it is called from the NodeManipulator and that "c" is available and is therefore referring to the the NodeManipulator.

The only "simple solution" I see is re-write the function (make sure to give it another name, to ensure that the NodeManipulator is still working) and add a third parameter (

Code: Select all

var([atmC], vbAtom, p(3))
), referring to the NodeManipulator (it contains a table that you want to re-use) and to replace all the reference with "c" with the new reference "atmC".

I hope this helps you further!

Cheers,

Harry

Re: connecting nodes without using a node manipulator

Posted: Wednesday 24 August, 2016 - 08:44
by HarryBunnik
Ha Jonas,

In addition. Please make sure that you save the atom on which the new function is created and that is loaded again the next time you need it. You can add the function to the NodeManipulator, but then with the next update of ED the updated version of the atoms are loaded, instead of your adjusted version.

You might want to create a personal atom in which you gather a tool-set of functions, that is always loaded when you start ED by creating a personal package, that contains you personal atom(s).

Good luck,

Harry