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 01-03-2013
Gavin Douglas Gavin Douglas is offline
Flexsim User
 
Join Date: Feb 2008
Posts: 65
Downloads: 1
Uploads: 0
Thanks: 27
Thanked 1 Time in 1 Post
Rep Power: 152
Gavin Douglas is on a distinguished road
Default Very Easy Question

It's been a while so excuse the easy question here. I want to set location of flow items on a pallet. So I used the setloc (item,xx,xx,xx) command and I know it doesn't work because the item is the pallet. How do I reference the items packed on the rack in order to use the setloc command in this case.

Thanks...
__________________
"A bird is an instrument working according to mathematical law, which is within the capacity of man to reproduce." -Leonardo da Vinci, 1502
  #2  
Old 01-03-2013
Phil BoBo's Avatar
Phil BoBo Phil BoBo is offline
Flexsim Development
 
Join Date: Jan 2008
Posts: 756
Downloads: 109
Uploads: 18
Thanks: 385
Thanked 1,483 Times in 525 Posts
Rep Power: 1174
Phil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond repute
Default

rank(item, N) will return a reference to the Nth flowitem within the specified item.
The Following User Says Thank You to Phil BoBo For This Useful Post:
Gavin Douglas (01-03-2013)
  #3  
Old 01-04-2013
Gavin Douglas Gavin Douglas is offline
Flexsim User
 
Join Date: Feb 2008
Posts: 65
Downloads: 1
Uploads: 0
Thanks: 27
Thanked 1 Time in 1 Post
Rep Power: 152
Gavin Douglas is on a distinguished road
Default further question

I'm trying to use the tote flow item as a pallet. So I go to the flow item bin and create a new pallet and attempt to change the 3d shape by pointing to the Tote. This isn't working. I want to then pack the tote onto a cart. So I would be stacking a “pallet” on top of “pallet.” I plan to run it through a combiner a second time with a cart as the “pallet.” I think this would work?


Any help would be greatly appreciated..
__________________
"A bird is an instrument working according to mathematical law, which is within the capacity of man to reproduce." -Leonardo da Vinci, 1502
  #4  
Old 01-07-2013
Sebastian Hemmann's Avatar
Sebastian Hemmann Sebastian Hemmann is offline
Flexsim User
 
Join Date: Sep 2009
Location: Braunschweig (Germany)
Posts: 439
Downloads: 52
Uploads: 0
Thanks: 472
Thanked 217 Times in 154 Posts
Rep Power: 319
Sebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to behold
Default

I would use the "Box" instead of the "Pallet" for what you are trying to do. There would not be any problems with positioning other Items on it ;-)
__________________
Hemmi
  #5  
Old 01-09-2013
Logan Gold Logan Gold is offline
Administrator
 
Join Date: Nov 2011
Posts: 6
Downloads: 1
Uploads: 0
Thanks: 0
Thanked 15 Times in 5 Posts
Rep Power: 0
Logan Gold will become famous soon enough
Default Combiner Pick List

Here is some code that you can use in a combiner's On Entry trigger. It is basically the same code that the pallet uses to stack flowitems, but it will stack flowitems into any other flowitem that comes through port 1 of a combiner.

The biggest difference I made to the code was add a buffer or spacing zone for inside the container. This can help prevent the flowitems from overlapping with the container's edges. For example, if you click on an object, you'll see the yellow box appear that indicates the dimensions of the object. In the code, when you put a number for the X buffer, this box effectively shrinks by the amount of the buffer in the X direction. And actually, it shrinks by twice the amount of the X buffer because the code assumes you want a buffer from both edges of the yellow box in the X direction. This is also true for the Y buffer, but the Z value only sets a buffer from the bottom of the container. If you don't care at all about the edges overlapping, just leave the values as 0 and the flowitems will stick stack correctly.

You can copy all the code from this post and paste it over the default header code on the On Entry trigger of the combiner to get it to work.

Code:
treenode item = parnode(1);
treenode current = ownerobject(c);
int port = parval(2);
{ //************* PickOption Start *************\\
/**Combine flowitems into any container.  Choose a buffer for the X, Y, and Z directions so the flowitems will not overlap with the container's edges.*/
/***popup:CombineItems*/
// If the flowitem is coming through port 1, then the flowitem is the container.
if(port == 1){
	// Used to make sure the flowitems look right in the container.
	switch_variable(item,"nochildscale",1);
}
// All other ports are used for the flowitems going into the container.
else{
	treenode container = first(current);
	treenode lastItem;
	/* The buffers are used to effectively shrink the area that the
	flowitems can be placed inside the container.  This is to help
	prevent any graphics overlap with the flowitems and the container edges.*/
	/** \nx: */
	double xBuffer = /***tag:nx*//**/0/**/;
	/** \ny: */
	double yBuffer = -/***tag:ny*//**/0/**/;
	/** \nz: */
	double zBuffer = /***tag:nz*//**/0/**/;
	/* Same idea as the buffers, except this will make sure all four
	sides of the container are included.  Otherwise, only one wall in
	the X or Y direction would container the buffer.*/
	double containerSX = xsize(container) - 2*xBuffer;
	double containerSY = ysize(container) + 2*yBuffer;
	if(content(container) != 0)	{
		lastItem = last(container);
	}
	// If this is the first item.
	if(content(container) == 0)	{
		setloc(item,xBuffer,yBuffer,zBuffer);
	}
	// Else if there is room between the right side of the last flowitem and the "east" wall of the container.
	else if(containerSX - (xloc(lastItem) + xsize(lastItem)) >= xsize(item)){
		setloc(item, xloc(lastItem) + xsize(lastItem), yloc(lastItem), zloc(lastItem));
	}
	// Else if there is room between the bottom of the last flowitem and the "south" wall of the container.
	else if(containerSY - (ysize(lastItem) - yloc(lastItem)) >= ysize(item)){
		setloc(item, xBuffer, -1 * (ysize(lastItem) - yloc(lastItem)), zloc(lastItem));
	}
	// Otherwise, put the flowitem on top of the layer that contains the last item.
	else{
		setloc(item, xBuffer, yBuffer, zloc(lastItem) + zsize(lastItem));
	}
}
} //******* PickOption End *******\\
The Following 2 Users Say Thank You to Logan Gold For This Useful Post:
Jörg Vogel (09-28-2013)


Thread Thread Starter Forum Replies Last Post
I think an easy question... - how to pointer to objects david_white Q&A 21 08-18-2008 12:20 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.