@Gabriel illescas Cavazos, The documentation for openip() and closeip() says the following:
"Modelers should only use this command when working with fluid objects because the internal behavior of discrete objects controls the opening and closing of their ports, and therefore this command may be overridden."
There really isn't a good way to close specific ports, and typically in order to close only one port you need to close either the output port(s) of the object flowing in through that port, or the input port(s) of the object the specific port flows to.
In your situation, if the upstream object has multiple output ports, and you don't want all of them to be closed you will have to write some custom logic to make sure the "Send To Port" field doesn't return the output port of the object you are trying to close the input.
closeinput(object) and closeoutput(object) are the commands that you should use, however, they will close all input/output ports, not just a single specified port.
For a situation where you have an upstream object with multiple outputs, and the downstream object with multiple inputs, and you don't want to close all the outputs of the upstream, or all the inputs of the downstream, then a workaround with no code is to place a "dummy" queue in between the two, which only has a single input coming from the upstream object, and a single output to the downstream. Then inputs/outputs could be closed on this dummy queue, without affecting the flow of any other objects.
You do have to take capacities into consideration. Closing inputs on the dummy queue will probably be the right approach to keep things the simplest, though it will depend on your own unique situation. You should also probably set the max content of the dummy queue to 1.
@Gabriel illescas Cavazos If you're using process flow you can use the command "object.input.close()".
Another tip if you're looking for commands, search the command helper. It's in the help drop-down menu in the toolbar. You can find all kinds of commands and even ideas for commands to use.
Im not using process flow, I use flexsim normal, and I use closeip(current,1); but it doesnt work, can you help me to close port 1 and leave port 2 in open form
7 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 | © Autodesk Inc. All rights reserved