question

Bo.W avatar image
0 Likes"
Bo.W asked Bo.W commented

The issue of ConveyorSystem on new DP‘s Position

hi,

Why are the positions of two DPs different after refreshing? Is there any way that decision point 1 can also be associated with conveyor 2 instead of conveyor 1. Is this the bug of the ConveyorSystem? The test results of 21.0.2 and 21.0.5 are the same.

DP create and setloc debugV21.0.5.fsm

FlexSim 21.0.5
conveyorsystemflexsim 21.0.5dp
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

Jordan Johnson avatar image
1 Like"
Jordan Johnson answered Bo.W commented

Instead of using function_s, use setProperty:

  1. Group newGroup = Group("newGroup");
  2. if( objectexists( Group("newGroup") ))
  3. {
  4. for(int i = newGroup.length; i > 0 ; i--){
  5. Group("newGroup")[i].as(Object).destroy(); }
  6. }
  7.  
  8. Object conveyor = createinstance( library().find("/?StraightConveyor"), model());
  9. conveyor.location.y = 1.5;
  10.  
  11. newGroup.addMember(conveyor);
  12.  
  13. Object decisionPoint = createinstance(library().find("/?DecisionPoint"), model());
  14. decisionPoint.setProperty("Location", conveyor.getLocation(0.5, 0.0, 0.0));
  15. decisionPoint.setProperty("DistAlongConveyor", 1.0);
  16.  
  17. newGroup.addMember(decisionPoint);
  18.  
  19.  
  20. conveyor = createinstance( library().find("/?StraightConveyor"), model());
  21. conveyor.location.y = 0;
  22. newGroup.addMember(conveyor);
  23. decisionPoint = createinstance(library().find("/?DecisionPoint"), model());
  24. newGroup.addMember(decisionPoint);
  25. decisionPoint.setProperty("Location", conveyor.getLocation(0.5, 0.0, 0.0));
  26. decisionPoint.setProperty("DistAlongConveyor", 1.0);

To associate a decision point with a specific conveyor, use setProperty to set it's location to the conveyor's location. Then use setProperty to set the DistAlongConveyor.

· 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.