Cheers, that works for some of them, not perfect. I've got it saved as an external rule and I can see it being used periodically. Inventor should still add an in-built tool.
The code is outdated, I run 2023, here is the code with some minor tweaks to allow it to work as an external rule out the box for anyone who comes across this thread in the future.
Sub main()
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
' Determine if there are any dimensions in the select set.
Dim oSelectSet As SelectSet
oSelectSet = oDrawDoc.SelectSet
Dim colDimensions As New Collection
Dim i As Long
For i = 1 To oSelectSet.Count
If TypeOf oSelectSet.Item(i) Is DrawingDimension Then
' Add any dimensions to the collection. We need to save them
' in something besides the selection set because once we start
' manipulating them the select set will be cleared.
colDimensions.Add(oSelectSet.Item(i))
End If
Next
If colDimensions.Count < 2 Then
MsgBox ("You must select at least 2 dimensions for this operation.")
Exit Sub
End If
' Ask the user if he/she wants vertical or horizontal alignment.
Dim bHorizontal As Boolean
If MsgBox("Do you want horizontal alignment? (Selecting ""No"" results in vertical alignment)", vbQuestion + vbYesNo, "Align Dimensions") = vbYes Then
bHorizontal = True
Else
bHorizontal = False
End If
For i = 1 To colDimensions.Count
Dim oDimension As DrawingDimension
oDimension = colDimensions.Item(i)
Dim dPosition As Double
If i = 1 Then
' Get the position of the first dimension text. This is
' the position the other dimensions will be aligned to.
If bHorizontal Then
dPosition = oDimension.Text.Origin.Y
Else
dPosition = oDimension.Text.Origin.X
End If
Else
' Change the position of the dimension.
Dim oPosition As Point2d
oPosition = oDimension.Text.Origin
If bHorizontal Then
oPosition.Y = dPosition
Else
oPosition.X = dPosition
End If
oDimension.Text.Origin = oPosition
End If
Next
End Sub