Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Charlies_3D_T
1150 Views, 10 Replies

Ilogic Center and Arrange dimensions but exclude dimensions under an angle

Hello,

 

I have following code for centering and arranging my dimensions. 

 

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 


End Sub 

 

I have 2 things i want to add: 

 

1) i want to be able to center an ordinate set also?

2) i have some dimensions under an angle and i want to exclude these angles. Is this possible? (see picture)

 

Hope some of you can help me out with this one.