Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
WCrihfield
in reply to: robertast

That last code would have only worked on real ChainDimensionSets that were created as chain dimension sets when created.  Here is an iLogic rule that attempts to combine all the different types of dimension types and all their different methods for arranging them.  This should catch pretty much any type of dimension you created on your drawing.   Try this:

If ThisApplication.ActiveDocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then
	MsgBox("This rule only works for Drawing Documents.",vbOKOnly, "WRONG DOCUMENT TYPE")
	Exit Sub
End If
Dim oDDoc As DrawingDocument = ThisDrawing.Document
Dim oSheet As Inventor.Sheet = oDDoc.ActiveSheet
Dim oDDims As DrawingDimensions = oSheet.DrawingDimensions
For Each oDDim As DrawingDimension In oDDims
	If TypeOf oDDim Is LinearGeneralDimension Or _
		TypeOf oDDim Is AngularGeneralDimension Then
		oDDim.CenterText
	End If
Next
For Each oBaselineDimSet As BaselineDimensionSet In oDDims.BaselineDimensionSets
	oBaselineDimSet.ArrangeText
Next
For Each oChainDimSet As ChainDimensionSet In oDDims.ChainDimensionSets
	oChainDimSet.Arrange(oChainDimSet.Members.Item(1))
Next
Dim oCollection As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection
Dim oLinGenDim As LinearGeneralDimension
For Each oGenDim As GeneralDimension In oDDims.GeneralDimensions
	If TypeOf oGenDim Is LinearGeneralDimension Then
		oCollection.Add(oGenDim)
	End If
Next
oDDims.Arrange(oCollection)

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click 'LIKE' :thumbs_up:.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)