ATTENTION

This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 05-15-2012
Albert Munoz Albert Munoz is offline
Flexsim User
 
Join Date: Sep 2010
Posts: 14
Downloads: 5
Uploads: 0
Thanks: 6
Thanked 0 Times in 0 Posts
Rep Power: 117
Albert Munoz is on a distinguished road
Default automatically connecting network nodes

Hello,

I have written the following script, based on what I have already read on the forum.
Code:
treenode nnobj=node("/NetworkNode", library);
treenode tnode1;
treenode tnode2;
tnode1 = createcopy(nnobj, model());
setname(tnode1, "test1");
setloc(tnode1, 0,1,0);
tnode2 = createcopy(nnobj, model());
setname(tnode2, "test2");
setloc(tnode2, 0,4,3);
contextdragconnection(tnode1, tnode2 , "A");
The code executes with no bugs and the network nodes appear just fine, but they are not connected. Any help would be greatly appreciated.

Thanks
Albert
  #2  
Old 05-16-2012
Jens Mühlheimer Jens Mühlheimer is offline
Flexsim User
 
Join Date: Jul 2008
Location: Stuttgart, Germany
Posts: 140
Downloads: 8
Uploads: 0
Thanks: 40
Thanked 35 Times in 27 Posts
Rep Power: 174
Jens Mühlheimer will become famous soon enoughJens Mühlheimer will become famous soon enough
Default

Hi Albert,

use createinstance() instead of createcopy().

Best, Jens
The Following User Says Thank You to Jens Mühlheimer For This Useful Post:
Albert Munoz (05-16-2012)


Thread Thread Starter Forum Replies Last Post
Flexscript question (network nodes and splines) ericdaoust Q&A 5 10-21-2013 10:03 AM
Trouble with network nodes Bill Lank Q&A 2 05-11-2012 09:49 AM
Connecting Network Node to Flowitem ericdaoust Q&A 2 01-06-2012 10:45 AM
Network Nodes Rachid Kolfin Q&A 14 02-03-2011 08:34 PM
Connecting network nodes in different containers KelvinHo Q&A 1 05-28-2008 06:49 AM


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.