How to force dimensions to align to dimension line?

My plugin imports AutoCAD dwg to Sketchup. For example
dimensions.skp (51.8 KB). But its dimensions are not correct.

Then I set Dimensions to Align to dimension line to get the correct result:

How can I force all dimensions to align to dimension line in my plugin? I checked API document and, but not found clue.

dimension.has_aligned_text = true

Note that DimensionLinear inherits from Dimension.


FYI: SketchUp does not have dimension styles like ACAD has. In fact, after some 20 years, we still cannot set the font face, size or boldness of dimension or callout text via extension code.

So, whereas ACAD combines model space and paper space in a single application, it is separated into SketchUp and LayOut in the Trimble application.

This type of dimension styling has instead been implemented in the LayOut paper space API.

So an extension could create the SKP model file without dimensions, and then a LayOut viewport that uses the model and imports ACAD dimensions into the LayOut document.