Define availability of a 3D Object, as a parameter

Define availability of a 3D Object, as a parameter

henry_p8
Not applicable
93 Views
5 Replies
Message 1 of 6

Define availability of a 3D Object, as a parameter

henry_p8
Not applicable

[ FlexSim 23.2.1 ]

Hi Community,

I need to define as parameter the availability of a 3D Object (Unloading docks), but these are in a Group. Could you support me with some logic, that allows me to create this activity. I will be grateful for your support. Thank you.


1697711848762.png

Answers - Parameters.fsm

0 Likes
Replies (5)
Message 2 of 6

Jacob_White
Community Manager
Community Manager
Accepted solution

Hi @Henry Paipa,

One way I've done this before is by adding and removing the object from the group. This means that if you are using the group as a resource, the object can no longer be used because it isn't a part of the group. Here is the code that I used to do this.


if(newValue == 1){
if(Group("Queues").isMember(reference) == 1){
return 0;
}
else{
Group("Queues").addMember(reference);
}
}
else{
if(Group("Queues").isMember(reference) == 0){
return 0;
}
else{
Group("Queues").removeMember(reference);
}
}

This was set up in a binary parameter with newValue representing the binary value input by the user.

parameter.png

Message 3 of 6

henry_p8
Not applicable

I'm sorry, I don't understand, can you help me with an example? I would appreciate it. @Jacob W2

0 Likes
Message 4 of 6

jason_lightfootVL7B4
Autodesk
Autodesk

If you want to add/ remove a group of objects (acting as a cell) to/from the model you can place them in a visual tool as a container and then and just those containers to a FlexSim Group which you can reference in the parameter table in order to alter the quantity of those cells in the model.

If you don't like the visual z-fighting that having lots of container planes in the model can cause, consider using the library from this post to give you more options on how they are depicted and how you interact with them.

0 Likes
Message 5 of 6

Jacob_White
Community Manager
Community Manager

Hi @Henry Paipa,

This is a basic model that demonstrates how the code I posted above works. Each of the processors are part of a group, "Processors". That group is referenced for a resource in the process flow. When the parameter for a specific processor is turned on or off, 1 for on, 0 for off, the object is either added or removed from the group "Processors". This means that if they aren't part of the group, they won't be used as a resource in the process flow.

Parameter availability.fsm

Message 6 of 6

henry_p8
Not applicable

This is just what I needed. I really appreciate it. Words can't express how thankful I am. @Jacob W2

0 Likes