Convert queue to rack

Convert queue to rack

eryn_c2
Not applicable
101 Views
4 Replies
Message 1 of 5

Convert queue to rack

eryn_c2
Not applicable

[ FlexSim 21.2.2 ]

Is there a way to convert a queue to a warehouse rack? I need to do this for multiple queues and am looking for a fast an easy way1.28 FGW - r9.fsm

0 Likes
Accepted solutions (1)
102 Views
4 Replies
Replies (4)
Message 2 of 5

joerg_vogel_HsH
Mentor
Mentor
Accepted solution

You can’t exchange objects. There doesn‘t exists a universal container to hold classes of objects you can replace.
You can

  • put objects to same locations,
  • set a rank in a tree previous or next to another object
  • rebuild new connections (in / out / center) by data of existing objects

You can do this all by FlexScript. Unfortunately you try to replace a Fixed Resource Class object by a module class object which behaves only optionally like a fixed resource.

Message 3 of 5

moehlmann_fe
Enthusiast
Enthusiast

Here is an example of how the code might look. The following copies an existing object (so you can set properties that will be shared between the racks beforehand, such as dimension for example). It then sets the location in the model and the tree and copies the send to port logic and connections to the new object.

Object queue = Model.find("QueueName");
Object storage = Model.find("RackName");

// Create copy
Object copy = createcopy(storage, queue.up);
// Copy location, tree rank and sendtoport
copy.location = queue.location;
copy.rank = queue.rank + 1;
copy.setVariable("sendtoport", queue.getVariable("sendtoport"));
// Copy connections
for(int in = 1; in <= queue.inObjects.length; in++)
{
    contextdragconnection(queue.inObjects[in], copy, "A");
}
for(int center = 1; center <= queue.centerObjects.length; center++)
{
    contextdragconnection(queue.centerObjects
, copy, "S"); } for(int out = 1; out <= queue.outObjects.length; out++) { contextdragconnection(copy, queue.outObjects[out], "A"); }
Message 4 of 5

jason_lightfootVL7B4
Autodesk
Autodesk

You would be better to transfer the connection nodes which will then preserve any port ranks on the other objects.

/**transferConnections() user command*/
//  useage: transferConnections(fromobj, toobj)

Object from=param(1);
Object target=param(2);

while (connectionscenter(from).subnodes.length)
    transfernode(connectionscenter(from).first,connectionscenter(target));


while (connectionsin(from).subnodes.length)
    transfernode(connectionsin(from).first,connectionsin(target));


while (connectionsout(from).subnodes.length)
    transfernode(connectionsout(from).first,connectionsout(target));
Message 5 of 5

ryan_c10
Not applicable

Hi @Eryn C2, was Joerg Vogel'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 unaccept and comment back to reopen your question.

0 Likes