question

George C2 avatar image
1 Like"
George C2 asked Matthew Gillespie rolled back

Code: Is it possible to set a curved conveyor's loc with only x & y coordinates?

From what I have seen from this forum, it seems that you need the coordinate position of the center of the circle (or radius + arc angle) along with the start_x, start_y, end_x, and end_y coordinate positions to accurately set the location of a curved conveyor.

My question is: is it possible to accurately set the starting and ending points of the curved conveyor with only the (x_start, x_end), and (y_start, y_end) coordinate positions?

//Create new conveyor
treenode newConveyor = createinstance(Model.find("Tools/MyObjects/customCurvedConveyor"), model());
setlabel( token, "CurrentConveyor", newConveyor );

//Current code that only sets it at a general location close to where I want to place conveyor + height (z coordinate) of the conveyor 
setloc( token.CurrentConveyor,
 token.StartX,
 token.EndY,
 token.HeightZ );

Intuitively, it seems to me that it should be possible, but from what I have read from this forum it seems that FlexSim doesn't code it that way.

FlexSim 19.1.0
conveyorcodelocationcoordinatescurved
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

Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered Matthew Gillespie commented

There are functions on the conveyors to set the start and end positions of the conveyor:

function_s(conveyor, "dragStart", 0, -5, 1);
function_s(conveyor, "dragEnd", 5, 0, 1);

However, you might not always get exactly the conveyor you're looking for since defining an arc by only its start and end position is ambiguous. For example, here are three different arcs that all start and end on the same points:


threearcs.png (6.6 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.