There are lots of code examples here on this forum that place dimension into drawings, but usually the most complicated part of the process is understanding the intents used within the various methods.
When placing dimensions on drawings using iLogic, there is a place to specify 'intent'. This 'intent' tells the dimension what geometry to attach it to, and usually at what point along that geometry to attach to. How you specify that intent determines how the dimension will attach to the geometry in the drawing.
Here are a few links that may help with this:
GeneralDimensions.AddLinear Method
GeometryIntent Object
PointIntentEnum Enumerator
If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.
If you have time, please... Vote For My IDEAS 💡or you can Explore My CONTRIBUTIONS
Inventor 2021 Help | Inventor Forum | Inventor Customization Forum | Inventor Ideas Forum
Wesley Crihfield

(Not an Autodesk Employee)