Connection

All topics on the Atoms in any Enterprise Dynamics Library.
giovanni
Posts: 97
Joined: Friday 21 September, 2012 - 17:30

Connection

Post 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
giovanni
Posts: 97
Joined: Friday 21 September, 2012 - 17:30

Re: Connection

Post by giovanni »

I find i use connect
User avatar
MatthijsJongboer
Posts: 200
Joined: Thursday 11 November, 2010 - 14:12

Re: Connection

Post 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
giovanni
Posts: 97
Joined: Friday 21 September, 2012 - 17:30

Re: Connection

Post 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
User avatar
MatthijsJongboer
Posts: 200
Joined: Thursday 11 November, 2010 - 14:12

Re: Connection

Post 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?
giovanni
Posts: 97
Joined: Friday 21 September, 2012 - 17:30

Re: Connection

Post by giovanni »

no any errors
User avatar
MatthijsJongboer
Posts: 200
Joined: Thursday 11 November, 2010 - 14:12

Re: Connection

Post by MatthijsJongboer »

Your code works for me. Maybe you can attach a model?
giovanni
Posts: 97
Joined: Friday 21 September, 2012 - 17:30

Re: Connection

Post 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
User avatar
MatthijsJongboer
Posts: 200
Joined: Thursday 11 November, 2010 - 14:12

Re: Connection

Post 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.
giovanni
Posts: 97
Joined: Friday 21 September, 2012 - 17:30

Re: Connection

Post 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?
Post Reply