question

Rocio A avatar image
0 Likes"
Rocio A asked Logan Gold answered

Redirect selected object to the GUI

Hello,

I have a question regarding the GUI.

In the tutorial it says: once you have associated an operator with the GUI and double click on the operator to open this window, the objectfocus attribute will change. You will specify a route to the operator you are editing. For example, you have associated an operator named Bob with this GUI. When you double-click Bob, this GUI is instantiated and its objectfocus attribute is set to the string path: "MAIN:/project/model/Bob".

https://docs.flexsim.com/en/24.1/Reference/DeveloperAdvancedUser/GUIs/KeyConceptsGUIs/KeyConceptsGUIs.html

Gui redirect ejemplo.fsm

However, my model in the objectfocus does not have the /Bob added.

Why does this happen?

And another question, is it possible to detach the object from the GUI?

Thank you

FlexSim 24.1.1
guitreeredirectobjectfocus
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Logan Gold avatar image
0 Likes"
Logan Gold answered

Hey @Rocio A , Jason means you can click on the viewfocus or objectfocus node and press P on the keyboard. You can also right-click on a node, go through Node, and click on "Add Coupling Data" to do the same thing. Either way, it will change the data of the node to be a pointer to the Object (Bob) instead of text data with the Object's path in the Model tree.

However, this change will only persist for as long as the GUI stays open. If you close the open GUI and open it again, it will revert to the Model tree path.

I'm guessing there was a change in the software at some point to start using the Object's path/rank in the Model tree and the documentation just wasn't updated to reflect that change, so that's why you're seeing something different in your model than what it says in the documentation. It's still doing the same thing, just in a different way.

I'm not sure if it's possible to change it so the GUI opens with pointer data, but I'll add an improvement suggestion to the dev list.

For your question about detaching the GUI from an Object, I don't think there is a button or option like the "Redirect selected objects..." option. You can always go into the Object's tree and manually change its GUI focus class to the default. For example, for Bob, you open its tree (MODEL:/Bob>special/guifocusclass), and change the text of this node to:

VIEW:/standardviews/modelingutilities/QuickerProperties

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Rocio A commented

The GUI instance is correctly pointing to the third node in the model - 'Bob':

1727955526009.png

However this isn't ideal in my view - if the model ranks are changing with the GUI open then the gui could end up changing the wrong object. It is better to add coupling data (press P) to the node so that it stores a pointer to the object instead:

1727955653445.pngAlso note that you need to explore the structure of the instantiated GUI to check these values - not the one that you define in Tools/GUIs.


1727955526009.png (3.8 KiB)
1727955653445.png (4.2 KiB)
· 5
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Rocio A avatar image Rocio A commented ·

Hello @Jason Lightfoot ,

In the model that I shared, the numbers that accompany the GUIs of your images do not appear.

I don't understand why /BOB doesn't appear in my model.

I attach some images of what I see in my model

Thank you

1728034125723.png

0 Likes 0 ·
1728034125723.png (100.4 KiB)
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Rocio A commented ·

"Also note that you need to explore the structure of the instantiated GUI to check these values - not the one that you define in Tools/GUIs."

Right click on the GUI that opens when you double click Bob and choose "Explore Structure"

0 Likes 0 ·
Rocio A avatar image Rocio A Jason Lightfoot ♦♦ commented ·

Hello @Jason Lightfoot ,

I have made a video with the steps you have indicated and what appears in your images does not appear.

and I don't understand what you mean with what you explained to me in the previous answer:

"However, this is not ideal in my opinion: if the model ranges change with the GUI open, then the GUI could end up changing the wrong object. It is better to add docking data (press P) to the node so that it stores a pointer to the object instead:"

Thanks in advance

0 Likes 0 ·
bob.mp4 (221.8 KiB)
Show more comments