ATTENTIONThis 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 |
|
Downloads |
Tips and Tricks Share helpful modeling ideas |
#1
|
|||
|
|||
Managing variables between nodes on complex travel networks
Hi all.
I am working on a model, where I use a pretty extensive travel network. Speeds on this network vary near turns and intersections, and it takes a lot of time to click around between net nodes and set all the speeds and other variables. To manage this more easily, I have written a bit of FlexScript to easily customize speeds between net nodes. The first bit here prints all outgoing speeds from a node designated as so() to the output console. Code:
clearconsole(); treenode conOut = node(concat(nodetopath(so,2),">connections/connectionsout")); pt(getname(so)); pt(":"); pr(); for(int x=1;x<=content(conOut);x++) { treenode Connection = rank(conOut,x); string Name = getname(Connection); treenode Node = rank(Connection,14); string Speed = numtostring(getnodenum(Node),1,4); pt(Name); pt(": "); pt(Speed); pr(); } Code:
treenode conOut = node(concat(nodetopath(so,2),">connections/connectionsout")); for(int x=1;x<=content(conOut);x++) { treenode Connection = rank(conOut,x); string Name = getname(Connection); treenode Node = rank(Connection,14); userinput(Node,concat(getname(so)," to ",Name)); } The code can be easily modified to look for / change other variables related to connections between network nodes. I hope someone out there can make use of this at some point. Best regards /Christian |
The Following User Says Thank You to Christian Norregaard For This Useful Post: | ||
Jörg Vogel (10-04-2013) |
Thread | Thread Starter | Forum | Replies | Last Post |
Very Large Models and Exporting Complex Data | brett forbes | Gripes and Goodies | 6 | 03-26-2015 05:39 AM |
Set up end speed for travel | Yiheng Feng | Q&A | 2 | 05-27-2013 09:36 AM |
difference between offset travel and travel? | zhang xin | Q&A | 2 | 08-20-2012 07:11 AM |
How to make a FR travel? | dalin cai | User Development | 3 | 10-10-2011 11:52 PM |
Operators on Multiple Networks | Nico Zahn | Q&A | 0 | 10-10-2007 03:02 AM |