Parametric (variable) round rectangle

I made a rounded rectangle (RoundRect) by :

  • create a Rectangle
  • create a Circle
  • drag the circle so it touches the Rectangle corner
  • use the Trim tool to delete segments of the Rectangle and Circle
  • set the circle Radius to a variable

it works nicely at my initial 5mm circle radius:

However, if I change the radius, say to 10mm, the two points of the arc stay fixed, so the end result is not what I want:

The problem appears to be that I locked the wrong points – if the radius changes, the edges of the Rectangle must logically change lengths too.

Is there a way to set this up so the radius can be changed while keeping the proper geometry?

Use tangent constraint. In general - learn how to use constraints this is the most important thing in the CAD.

Thank you, that was it. The solution:

  • select one line segment and the arc that touches it.
  • Change the Constraint to Tangent. Repeat for all 8 of them.
  • Also, unlock all of the locked points, especially including the Arc Center, which needs to be free to move

Now it works, here is 10mm radius: