Question on how to change rotation of an item leaving a processor

Question on how to change rotation of an item leaving a processor

jakub_hertmanowski
Observer Observer
339 Views
2 Replies
Message 1 of 3

Question on how to change rotation of an item leaving a processor

jakub_hertmanowski
Observer
Observer

Hello!
I'm fairly new to FlexSim and I'm making my first semi-advanced simulation. I want to have a processor turn metal coils into rollers. Graphic side works perfectly well, but now I'm trying to simulate defects. I've wrote some code which preety much does what i expected:

Object item = param(1);

if (item)
{
double probability = 0.50;
double r = uniform(0,1);

if (r < probability)
{
item.color = Color(255, 0, 0);
item.size = Vec3(2, 1, 1);
}
}

It changes the color and size according to my probability, but I also want to change item's rotation. In the documentation i found the setRotation() method but using  item.setRotation(45, 45, 0); doesnt seem to do anything. Is there something I'm doing wrong? Is there another approach to this problem?

Thanks in advance for any advice!

0 Likes
Accepted solutions (1)
340 Views
2 Replies
Replies (2)
Message 2 of 3

FelixMoehlmann
Collaborator
Collaborator
Accepted solution

Does the item enter a conveyor after leaving the processor? Because that will reset the rotation (or rather apply whatever orientation is set in the Entry Transfer). You would have to set a label and use the "Movement" options in the triggers of Decision Points or Photo Eyes to change the rotation on the conveyor.

0 Likes
Message 3 of 3

jakub_hertmanowski
Observer
Observer

Thank you very much! That was indeed the case. Since I was outputting directly onto a conveyor, the rotation was being reset — which makes sense now that you mentioned it. It works perfectly with Decision Points though!

0 Likes