MATLAB: Does accessing block parameters that are inside a configurable subsystem not work in Simulink 7.5 (R2010a)

simulink

I have a model with a configurable subsystem in it. If I access the block parameters inside the configurable subsystem, I do not receive correct results.
For example, suppose I have a model named 'MyModel' with a configurable subsystem named 'DynamicSubsystem'. Also, assume that this configurable subsystem has couple of possible subsystems inside that can be selected. Now, if I try to access the background color of input port inside this configurable subsystem using the following MATLAB command,
get_param('MyModel/DynamicSubsystem/In','BackgroundColor')
it returns 'white' for any background color of the input port. Is this expected?

Best Answer

This is intended behavior. The configurable subsystem adds an additional hierarchy layer into your block. The block is designed so that the users cannot see that additional layer and consequently making the switching between different block choices more seamless.
To workaround this issue, you have to specify the currently selected block in your query. The following command can be used to get the correct block parameter and is independent of currently selected block in configurable subsystem:
get_param(['MyModel/' get_param('MyModel/DynamicSubsystem','BlockChoice') '/In'],'BackgroundColor')