question

Ignacio H2 avatar image
0 Likes"
Ignacio H2 asked Ignacio H2 commented

Rotate the car

FlexSim 23.0.14
conveyorrotationcar
5-car-body.jt (20.0 KiB)
car-rotated.fsm (61.5 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Ignacio H2 commented

Either you change the shape factors in the flow item bin, so that the 3d shape is rotated 'correctly' within the bounding box (forward: positive along the x-axis, up: positive along the z-axis).

capture1.png

Or you change the rotation within the model in the properties of the entry transfer and the On Entry trigger of the combiner.

capture2.png

capture3.png

In the On Entry trigger you would also need to customize the code so that only the items entering through port 2 are rotated.


capture1.png (32.1 KiB)
capture2.png (7.5 KiB)
capture3.png (4.6 KiB)
· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Ignacio H2 avatar image Ignacio H2 commented ·

Hello Felix, thanks for your answer and idea. Could you send me the FlexSim file with this changes? Just to see the code.

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Ignacio H2 commented ·

Set up the "Set Rotation" option as you would normally, then simply enclose everything between "Pickoption Start" and "Pickoption End" in an if-condition that checks if the item entered through port 2.

{ // ************* PickOption Start ************* //
if(port == 2) {     /***popup:SetSizeLocRot*/     /***tag:name*//**Set Rotation*/     Object involved = /** \nObject: *//***tag:object*//**/item/**/;     double x = /** \nx: *//***tag:nx*//**/-90/**/;     double y = /** \ny: *//***tag:ny*//**/0/**/;     double z = /** \nz: *//***tag:nz*//**/180/**/;     /** \nCommand: *//***tag:command*//**/setrot/**list:setloc~setrot~setsize*/(involved, x, y, z); } } // ******* PickOption End ******* //
0 Likes 0 ·
Ignacio H2 avatar image Ignacio H2 Felix Möhlmann commented ·
Thanks! It is working!
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.