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 10-04-2008
Vic Li Vic Li is offline
Flexsim User
 
Join Date: Mar 2008
Posts: 39
Downloads: 0
Uploads: 0
Thanks: 6
Thanked 1 Time in 1 Post
Rep Power: 150
Vic Li is on a distinguished road
Default a question about the command "getitemtype"

If I am in the queue3, I want to get the item type in the queue4.
How do I write the correct command?

I already try the following stupid code,but it can't work.

treenode item = parnode(1);
treenode current = ownerobject(c);
int port = parval(2);
treenode cc = node("/Queue4",model());

getitemtype(cc,item); or getitemtype(item,cc)

thanks for your help in advance.

Last edited by Vic Li; 10-04-2008 at 11:48 PM.
  #2  
Old 10-04-2008
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

The item in your code is the one that fires the trigger - I assume in Queue3.

Once you have the pointer to the other queue (6 or 4 in your example?) you can use rank, first or last to find one of the items in the other queue, which could have any number within it.


Code:
int type=getitemtype(rank(cc,1));
or

Code:
 
treenode otheritem=rank(cc,1);
int type=getitemtype(otheritem);
See the command help for the use of rank, first and last
The Following User Says Thank You to Jason Lightfoot For This Useful Post:
Tomasz Kisiel (06-11-2012)
  #3  
Old 10-04-2008
Vic Li Vic Li is offline
Flexsim User
 
Join Date: Mar 2008
Posts: 39
Downloads: 0
Uploads: 0
Thanks: 6
Thanked 1 Time in 1 Post
Rep Power: 150
Vic Li is on a distinguished road
Default

sorry,there's a mistake in my problem description,I correct it .thanks for your help.


Thread Thread Starter Forum Replies Last Post
The "Simple Question" Thread Xavier Jackson Q&A 202 08-10-2009 09:44 AM
I have a "priority" question Li Chin Q&A 6 09-15-2008 08:11 AM
Is it possible one object comprised of the function of "combiner" and "separetor"? Vic Li Q&A 1 08-19-2008 04:41 AM
is there a command opposite to "destroyobject" which create a object? KelvinHo Q&A 3 07-03-2008 08:09 AM
Does the "loaduserlibrary" command has a flaw? Steven Hamoen Q&A 1 06-03-2008 02:47 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.