Hi @Ankur A3, was one of Jason Lightfoot's or Felix Möhlmann's answers helpful? If so, please click the "Accept" button at the bottom of the one that best answers your question. 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.
You shouldn't open/close individual port connections, as those are controlled by the internal logic of the fixed resource and your command might be overridden.
To stop items from flowing in your example you would only close the (entire) input of Queue1. For that you only need a reference to Queue1 ("object.input.close()").
If Queue1 had multiple input connections and you only wanted to prevent items flowing through one, you could use intermediate queues with only one input each and close their input.
For completeness: You can get the port number which an object connects to on an upstream or downstream object with "ipopno()" and "opipno" (see command helper in FlexSim for further explanation)
Hi @Felix Möhlmann,
If Queue1 has multiple input ports, then using your approach may break the space constraint. What will you recommend in this case?
Thank you!
Based on your example, why would simply limiting the content of the queues to 10 not work in this case? That would require no closing/opening whatsoever.
Update:
If you only have the object reference, then the only option is to loop through the connected objects and compare them to the target. See the user command in the attached model.
I was looking for exactly same.
It might be simplest to create your own object using a BasicFR and control the ports yourself.
Or you could use the pull to determine if you are taking items from the upstream object as described below using a Map.
In the attached model at reset I create a Map label 'portMapIn' that is keyed on the input objects so that you can look up the port number quickly - this is a user command 'createPortMapIn'.
There are two other commands closeConnection() and openConnection() that take the receiver and send objects as parameters and update a portClosed label array on the receiver that is referenced by the pull.
If you run to the stop point in the model and step past it you'll see Queue2 received an item from Processor1. If you then repeat that but run the script to close the connection between those two, the transfer does not take place when you perform a step. The transfer then takes place immediately when you open the connection.
15 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © 2025 Autodesk Inc. All rights reserved