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 07-28-2009
Nico Zahn's Avatar
Nico Zahn Nico Zahn is offline
Flexsim User
 
Join Date: Sep 2007
Location: Bingen am Rhein, Germany
Posts: 179
Downloads: 19
Uploads: 4
Thanks: 66
Thanked 60 Times in 32 Posts
Rep Power: 201
Nico Zahn has a spectacular aura aboutNico Zahn has a spectacular aura about
Default Drawing a Sankey Diagramm

Hi,
I want the path on the network to grow in width with every transporter driving over the network node. So I increase a label each time the transporter enters the networknode.
Now I use the onDraw trigger of the networknode like this:

double d_width;
treenode t_obj;
drawtomodelscale(current);

for(int x=1;x<=nrop(current);x++)
{
t_obj=outobject(current,x);
d_width=getlabelnum(current,x+1)/100;
glLineWidth(d_width);
drawline(view,xloc(current),yloc(current),zloc(cur rent),xloc(t_obj),yloc(t_obj),zloc(t_obj),0,1,0);
}


So this is working fine, but the origin of the lines is far away from the networknode. If I use xloc(current), yloc(current) and zloc(current) the line should start at the networknode??
__________________
kind regards Nico.
  #2  
Old 07-28-2009
Tom David's Avatar
Tom David Tom David is offline
Flexsim User
 
Join Date: Aug 2007
Location: Schwaebisch Gmuend, Germany
Posts: 430
Downloads: 157
Uploads: 47
Thanks: 486
Thanked 450 Times in 233 Posts
Rep Power: 520
Tom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant future
Default

Nico,

your code is only working if the first NN has location (0,0,0).

I modified your code a bit and it seems to work, but I am not sure, because if I change the location of NN2 it works in my little example,
but does not work, if I change location of NN1. Then I need to change the location of NN2 and it works even if I put it on the same position.
By the way, your code is not using label 1 but label x + 1, so I change this to x.

Anyway, maybe my code give you some hints.
Don't ask me about the commands, I have no clue what I am doing ...

double d_width;
treenode t_obj;
drawtomodelscale(current);
for(int x=
1;x<=nrop(current);x++)
{
t_obj =
outobject(current,x);
d_width =
getlabelnum(current,x)/100;
glLineWidth(d_width);
double dX =
vectorprojectx(model(), xloc(t_obj),yloc(t_obj),zloc(t_obj), current);
double dY =
vectorprojecty(model(), xloc(t_obj),yloc(t_obj),zloc(t_obj), current);
double dZ =
vectorprojectz(model(), xloc(t_obj),yloc(t_obj),zloc(t_obj), current);
drawline(view,0,0,0,dX,dY,dZ,0,1,0);
}

__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions."
The Following 3 Users Say Thank You to Tom David For This Useful Post:
Simon Farsah (07-28-2009)
  #3  
Old 07-29-2009
Nico Zahn's Avatar
Nico Zahn Nico Zahn is offline
Flexsim User
 
Join Date: Sep 2007
Location: Bingen am Rhein, Germany
Posts: 179
Downloads: 19
Uploads: 4
Thanks: 66
Thanked 60 Times in 32 Posts
Rep Power: 201
Nico Zahn has a spectacular aura aboutNico Zahn has a spectacular aura about
Default

Hi Tom,
thanks for the hint.
You have to project the coordinates of the starting object (current) as well.
I now use a triangle to show the amount of transports.
Attached you will find the working model.
Attached Files
File Type: zip 2009_07_28_Sankey_triangle_ZN.zip (92.8 KB, 248 views)
__________________
kind regards Nico.
The Following 3 Users Say Thank You to Nico Zahn For This Useful Post:
Tom David (07-29-2009)
  #4  
Old 07-29-2009
Tom David's Avatar
Tom David Tom David is offline
Flexsim User
 
Join Date: Aug 2007
Location: Schwaebisch Gmuend, Germany
Posts: 430
Downloads: 157
Uploads: 47
Thanks: 486
Thanked 450 Times in 233 Posts
Rep Power: 520
Tom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant future
Default

I an not sure, but in my case it is working. But maybe because I do it different.

Because it looks like that some people are interested in sankey diagram, I built also a small sample model.

http://www.flexsim.com/community/for...do=file&id=212

There it is shown how I did it and I am sure we learned from each other. Thanks Nico.

Yes, Flexsim can do a sankey diagram ...
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions."
The Following 2 Users Say Thank You to Tom David For This Useful Post:
Simon Farsah (07-30-2009)
  #5  
Old 07-29-2009
Nico Zahn's Avatar
Nico Zahn Nico Zahn is offline
Flexsim User
 
Join Date: Sep 2007
Location: Bingen am Rhein, Germany
Posts: 179
Downloads: 19
Uploads: 4
Thanks: 66
Thanked 60 Times in 32 Posts
Rep Power: 201
Nico Zahn has a spectacular aura aboutNico Zahn has a spectacular aura about
Default

Hi Tom,
thank you for your modell.
I looked at it and I just like to mention that when you are executing an offset travel the arrival trigger will be executed twice, but the toedge is 0, so there will be no counting on the lables.
Just in case someone modifies your modell an forgets about this behavior...
__________________
kind regards Nico.
  #6  
Old 08-05-2009
Nico Zahn's Avatar
Nico Zahn Nico Zahn is offline
Flexsim User
 
Join Date: Sep 2007
Location: Bingen am Rhein, Germany
Posts: 179
Downloads: 19
Uploads: 4
Thanks: 66
Thanked 60 Times in 32 Posts
Rep Power: 201
Nico Zahn has a spectacular aura aboutNico Zahn has a spectacular aura about
Default

Hi,
in my last model was a bug, so the triangles where only shown correctly when the tow linked nodes where on the same x-coordinate. Attached you find the modell with columns which are now 3d(wow) and are rotated towards the linked node.
Attached Files
File Type: zip 2009_08_05_column.zip (91.3 KB, 242 views)
__________________
kind regards Nico.
The Following User Says Thank You to Nico Zahn For This Useful Post:
Tom David (08-05-2009)


Thread Thread Starter Forum Replies Last Post
Need explanation of Flexsim drawing commands AlanZhang Q&A 2 04-17-2008 10:24 AM
How to prepare an AutoCAD drawing for Flexsim import. Regan Blackett Tips and Tricks 1 11-07-2007 07:08 PM


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.