You’ll have to get the array of Dimension Segments <Dimension.Segments> and iterate through the list and change the IsLocked property. of each DimensionSegment.
Don’t know if there is a node for that, but the python is pretty straightforward.
I will add that it can be good to have access to revit lookup, because looking at all the objects/properties on a object can help to understand these little areas of quirks as you can drill down the data and see where the information is saved.
Then of course can dig correctly in the SDK, learning resources or even online help to navigate to the correct methods.