function bd = getBlockDiagram(smc)
%GETBLOCKDIAGRAM Utility to get the block diagram.
% the configuration component is associated. It may be that
% the component is associated with NO block diagram. In this
% case the return value will be empty

% Author(s): P. Costa
% Copyright 2005-2012 The MathWorks, Inc.
%

bd = smc.up;
while ~(isempty(bd) || bd.isa('Simulink.BlockDiagram'))
bd = bd.up;
end

% [EOF]