Mor,
The way to model a detaching mass is as a lineforce combined with a stiff spring representing the rigid translation. By editing a spring component, you can make the spring "give up" and apply no force when a boolean variable changes.
Here is an example system:

The detachable spring is coded:
model DetachableSpring
import SI = Modelica.SIunits;
extends Modelica.Mechanics.Translational.Interfaces.PartialCompliant;
parameter SI.TranslationalSpringConstant c(final min = 0, start = 1) "spring constant ";
parameter SI.Distance s_rel0 = 0 "unstretched spring length";
Modelica.Blocks.Interfaces.BooleanInput attached annotation(Placement(visible = true, transformation(origin = {-100.0, 68.0}, extent = {{-20.0, -20.0}, {20.0, 20.0}}, rotation = 0), iconTransformation(origin = {0.0, 120.0}, extent = {{-20.0, -20.0}, {20.0, 20.0}}, rotation = -90)));
equation
f = if attached then c * (s_rel - s_rel0) else 0;
end DetachableSpring;
The simulation looks like this (note the distance between the masses is plotted in the background showing the release at 3.5 seconds.
The full model is attached.

Regards,
Neil
Attachments: