Gilles avatar image
Gilles asked Jeanette F commented

create decision point on incline conveyor

hello Team,

I am creating decision point on conveyor with a code. when the conveyor is flat, there is no issue the decision point is placed on the conveyor. however, when the conveyor is inclined (height at start is different than height at end of conveyor), the decision point is not placed on conveyor.

could you tell me how to place decision point on inclined conveyor?

myNode = createinstance(maintree().find("project/userlibrary/DecantLineLibrary/DP_Rotation"), currentConv); = objName;



FlexSim 23.2.1
decision pointusing code
· 1
5 |100000

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

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Gilles , was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes 0 ·

1 Answer

Felix Möhlmann avatar image
Felix Möhlmann answered

Generally, decision points would not be placed inside the conveyor. And the location coordinates of conveyors work differently from other objects which is likely why you are having problems placing the DP in the correct location.

Using the start and end location of the conveyor to calculate the position of the DP works. Though either the DP has to be inside the same container as the conveyor or the location coordinates must be projected to from the conveyor's container to that of the DP.

Object conveyor;
Object dp = Object.create("Conveyor::DecisionPoint"); Vec3 convStartLoc = conveyor.getProperty("StartLocation"); Vec3 convEndLoc = conveyor.getProperty("EndLocation"); double lengthFactor = 0.5; // DP is placed this fraction along the length of the conveyor Vec3 targetLoc = convStartLoc*(1-lengthFactor) + convEndLoc*lengthFactor; dp.setLocation(targetLoc, Vec3(0.5, 0.5, 0)); function_s(dp,"finalizeSpatialChanges");
5 |100000

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