Page 1 of 2

Connection

Posted: Friday 19 October, 2012 - 10:32
by giovanni
Hello

I would like to know if there is a simple way to connect Atom then drag lines form input to output ?

Thank you

Re: Connection

Posted: Friday 19 October, 2012 - 11:42
by giovanni
I find i use connect

Re: Connection

Posted: Friday 19 October, 2012 - 11:49
by MatthijsJongboer
Hello Giovanni,

Yes, there is. A lot of atoms have written AutoConnect on the OnCreation Eventhandler. This is a function (defined in the Kernel Functions Atom) to connect atoms that are dragged into the model layout. You can write your own code using the 4DScript command 'Connect'. It's not a simple way but since you ask this question, I expect you are looking for a smarter solution.

Gr. Matthijs

Re: Connection

Posted: Tuesday 23 October, 2012 - 16:09
by giovanni
yep i use the interact window
but i can manage really smart solution because this code doesn´t work:

Do( globalvar([Num],vbvalue,1),
While(Num<10,
do(connect(1,atombyname(concat([Server],string(Num)),Model),Num,atombyname([Crane],Model)),
Num:=Num+1)

I don´t get why (maybe because Num became a vbstring variable)

Thank

Re: Connection

Posted: Tuesday 23 October, 2012 - 16:31
by MatthijsJongboer
Your code seems to be OK.
It will connect the servers in the model named Server1 to Server9. The connection is made from Outpuchannel 1 of each server to inputchannel Num of the Crane.
Num is defined as a vbvalue so your typecast works fine.
When the atoms and channels exist, it should work. Do you get any error messages?

Re: Connection

Posted: Wednesday 24 October, 2012 - 09:31
by giovanni
no any errors

Re: Connection

Posted: Wednesday 24 October, 2012 - 10:18
by MatthijsJongboer
Your code works for me. Maybe you can attach a model?

Re: Connection

Posted: Wednesday 24 October, 2012 - 15:13
by giovanni
i got the error
because num go from 1 to 67
until 9 i have to use [server0],string(num)
from10 to 67 i have to use [server],string(num)

Thank any way

Re: Connection

Posted: Wednesday 24 October, 2012 - 15:43
by MatthijsJongboer
I see. I used a few atoms that I created using drag-drop. Then the code works.
Well. I'm glad you found it.

Re: Connection

Posted: Wednesday 24 October, 2012 - 15:51
by giovanni
do u have an idea how can in 3d visualization leave teh product on the container when they enter in the unpack atom?