Container "Fit Size to Contents" button activated by code

Container "Fit Size to Contents" button activated by code

lenapasich
Explorer Explorer
150 Views
1 Reply
Message 1 of 2

Container "Fit Size to Contents" button activated by code

lenapasich
Explorer
Explorer

The idea is to set up process parameters in Excel file and then import those values. Based on that, I'm creating containers by code and some objects (queues, processors) inside them. Container's size may differ depending on what's specified in the Excel file. I couldn't find any way to activate "Fit Size to Contents" by code even though other properties such as "Edit in Place" can be accessed by tree. Is there any function_s or other way to do so?


lenapasich_0-1780043231896.pnglenapasich_0-1780044006427.png

 

 

0 Likes
Accepted solutions (1)
151 Views
1 Reply
Reply (1)
Message 2 of 2

FelixMoehlmann
Collaborator
Collaborator
Accepted solution

You can inspect GUI elements by right-clicking and choosing "View -> Explore Structure". This let's you check what code gets executed when you click on a button for example. The button in question executes a function_s() command. It also passes in a reference to the view (which might be a problem in other code because the view is not guaranteed to exist). But testing the command without the last parameter suggests that this is not mandatory.

Screenshot 2026-06-05 134808.png

 

TLDR: "function_s(container, "fitSizeToContents)" is the command you are looking for.