Lock/Constrain Dimensions

it seems there is a Revit API property for setting the lock state:
https://www.revitapidocs.com/2015/496d64c6-3642-577d-7631-96956baed820.htm

However, looking at the remarks, it may not work on a string of dimensions:
This property always returns false if the dimension is a radial or spot dimension. This property cannot be set if the dimension has been labeled, or if the dimension shape is arc-length, radial, diameter or spot, or if the dimension is linear with more than one segment.