Hi!
To do this, you need to select the correct DimensionType object in the project. You can do this via the FilteredElementCollector class or directly by the Id value (you can find it out with RevitLookup by creating a dimension manually in the project and looking up the Id of its dimension type).
Here is a small example of creating a dimension that shows the arc length of the detail line. Note that you need to set the ComputeReferences property in the Options object to be able to get references to the start and end of the arc.
In this code, the dimension will be created at the same location as the original arc. If you want to place the dimension somewhere else, you have to offset the original arc and pass it instead of the original arc.
options = DB.Options()
options.ComputeReferences = True
arc = detail_line \
.Geometry[options] \
.Where(lambda x: isinstance(x, DB.Arc)) \
.First()
dimension_type = doc.GetElement(DB.ElementId(2530))
with DB.Transaction(doc, 'Create Arc Length Dimension') as t:
t.Start()
DB.AngularDimension.Create(
doc,
doc.ActiveView,
arc,
[
arc.GetEndPointReference(0),
arc.GetEndPointReference(1)
],
dimension_type
)
t.Commit()

Maxim Stepannikov | Architect, BIM Manager, Instructor