You can use conditional components in Modelica.
model myNewModel parameter Boolean use_Something; myLibrary.myComponent component if use_Something; end myNewModel;
This component may then only be used in connect-statements. If the condition is false, these connections are ignored by the tool.