create decision point on incline conveyor

create decision point on incline conveyor

gguedia5QZFN
Participant Participant
23 Views
2 Replies
Message 1 of 3

create decision point on incline conveyor

gguedia5QZFN
Participant
Participant

[ FlexSim 23.2.1 ]

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);

myNode.name = objName;

setloc(myNode,0,0,0);

function_s(myNode,"finalizeSpatialChanges");

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

moehlmann_fe
Explorer
Explorer
Accepted solution

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");
0 Likes
Message 3 of 3

Jeanette_Fullmer
Community Manager
Community Manager

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