How can the handle to the currently visible Stateflow.Box object be obtained?

Illustration
assignmenthelppro - 2021-10-21T11:54:54+00:00
Question: How can the handle to the currently visible Stateflow.Box object be obtained?

It is possible to obtain the handle to the currently visible Stateflow.Chart object by using the following command:   >> s = sfroot; >> c = s.find('-isa', 'Stateflow.Chart', '-and', 'Visible', 1); What is the equivalent property for a Stateflow.Box object? The following command returns an empty 0x1 handle: >> b = s.find('-isa', 'Stateflow.Box', '-and', 'Visible', 1);  

Expert Answer

Profile picture of Kshitij Singh Kshitij Singh answered . 2025-11-20

The command returns an empty handle because the Stateflow.Box constructor does not have a 'Visible' method. Hence, it would not be possible to programmatically query the currently visible Box object similar to how a Chart object is queried.
 
There are two possible ways in which this can be achieved:
 
1. If you are interested in programmatically querying and obtaining a handle to a currently visible Stateflow Object (chart, box, state etc.), click on the object-of-interest
 
and then use the 'sfgco' command.
 
2. If you are already aware about the names of the objects to be queried, then it is possible to directly filter these objects out by using their names:
>> c = s.find('-isa', 'Stateflow.Chart', '-and', 'Name', 'chart_name');
>> b = s.find('-isa', 'Stateflow.Box', '-and', 'Name', 'box_name');
Using the 'Name' property would return the handles to the required objects directly.
 


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!