- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Thank you!
It's working perfect almost!
See pictures below.
1 is what it needs to be but 2 is what i get with your rule on horizontal and vertical dimensions...
This is the rule i had before:
Sub Main
Dim oDoc As DrawingDocument
oDoc = ThisDoc.Document
' Set a reference to the active sheet
Dim oSheet As Sheet
oSheet = oDoc.ActiveSheet
Dim oDrawingDim As DrawingDimension
Dim oDrawingDims As DrawingDimensions
Dim oDimsToBeArranged As ObjectCollection
' Iterate over all dimensions in the drawing and
' center them if they are linear or angular.
' Add them to the ObjectCollection to be arranged
oDrawingDimensions = oSheet.DrawingDimensions
oDimsToBeArranged = ThisApplication.TransientObjects.CreateObjectCollection
For Each oDrawingDim In oDrawingDimensions
If TypeOf oDrawingDim Is LinearGeneralDimension Then
oDrawingDim.CenterText
oDimsToBeArranged.Add(oDrawingDim)
End If
Next
If oDimsToBeArranged.Count > 0 Then
oDrawingDimensions.Arrange(oDimsToBeArranged)
End If