Recently, I was asked how one might constrain a connector width in an instance parameter to be less than the width of solid it is hosted on. In the specific case, there are two solids, one representing the main body of the equipment, and the duct 'collar' on which the connector is hosted. The duct size must match the collar, and the collar must stay smaller than the equipment.
The formula below to control the collar size works just fine... however, when you select the family instance in the project, you can use the blue numerical control to set the connector width to something larger than the geometry... as you can see from the formulae, there is are no constraints on the actual duct connector sizes.

The problem is one of validation, not constraints/dimensions. As you can see in the revised parameters below, there are a couple of checks to make sure the duct size stays smaller than the section size. If the duct is modified to be bigger than the body, we force the collar length to 0, which Revit will not allow, and a error to the user will force them to undo the invalid setting.

How would you approach this problem?