Johan is suggesting to use the visible attribute to do what you want. Here is a quick example.
model Model1
parameter Boolean on = true;
annotation(Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5}), graphics = {Ellipse(visible = not on, origin = {-27.5, 5}, fillColor = {0, 128, 0}, fillPattern = FillPattern.Solid, extent = {{-27.5, -40}, {27.5, 40}}), Rectangle(visible = on, origin = {-23.742, 5}, fillColor = {255, 0, 0}, fillPattern = FillPattern.Solid, extent = {{-51.258, -40}, {51.258, 40}}), Ellipse(visible = not on, origin = {32.5, 35.307}, fillColor = {0, 0, 255}, fillPattern = FillPattern.Solid, extent = {{-17.5, -17.255}, {17.5, 17.255}})}));
end Model1;
Note that I have a put a red square and a green and a blue circle on the diagram view. I then edited the annotation to make the "visible" attribute depend on the boolean variable (or you could use some test like x>3).
when true:
When False