11-04-2020
12:03 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
11-04-2020
12:03 PM
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'
.
Wesley Crihfield
(Not an Autodesk Employee)