Hi @C_Haines_ENG. Here is an example iLogic rule I just created that may help. This one is designed to check every dimension on every sheet to see if it is using your metric DimensionStyle, and if it is, change its Style to your imperial DimensionStyle. So, it first tries to get both of those DimensionStyles to variables before it begins looping through all dimensions. If it does not find either one, it will let you know, then exit the rule without continuing. If it finds both, it then continues to check and change the style of all dimensions. The process is reversible too, because I made it into a separate Sub routine which you can supply the two styles to, so you can just reverse them.
Sub Main
If ThisDoc.Document.DocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then
MsgBox("A Drawing document must be active for this code to work. Exiting.", vbCritical, "")
Exit Sub
End If
Dim oDDoc As DrawingDocument = ThisDoc.Document
Dim oDimStyles As DimensionStylesEnumerator = oDDoc.StylesManager.DimensionStyles
'try to get your regular metric DimensionStyle
Dim oMMDimStyle As DimensionStyle = Nothing
Try
oMMDimStyle = oDimStyles.Item("mm")
Catch
MsgBox("Error trying to get DimensionStyle named 'mm'.", vbCritical, "")
Exit Sub
End Try
If IsNothing(oMMDimStyle) Then Exit Sub
'try to get your Imperial DimensionStyle
Dim oInDimStyle As DimensionStyle = Nothing 'for Imperial Style
Try 'assuming your Imperial style is named "in" for inches
oInDimStyle = oDimStyles.Item("in") '<<<EDIT THIS>>>
Catch
MsgBox("Error trying to get DimensionStyle named 'in'.", vbCritical, "")
Exit Sub
End Try
If IsNothing(oInDimStyle) Then Exit Sub
ChangeAllDimStyles(oDDoc, oMMDimStyle, oInDimStyle)
End Sub
Sub ChangeAllDimStyles(oDrawDoc As DrawingDocument, oFrom As DimensionStyle, oTo As DimensionStyle)
'loop through all dimensions and change their Style
For Each oSheet As Sheet In oDrawDoc.Sheets
Dim oDDims As DrawingDimensions = oSheet.DrawingDimensions
Dim oBLDimSets As BaselineDimensionSets = oDDims.BaselineDimensionSets
Dim oCDimSets As ChainDimensionSets = oDDims.ChainDimensionSets
Dim oGenDims As GeneralDimensions = oDDims.GeneralDimensions
Dim oODims As OrdinateDimensions = oDDims.OrdinateDimensions
Dim oODimSets As OrdinateDimensionSets = oDDims.OrdinateDimensionSets
If oBLDimSets.Count > 0 Then
For Each oBLDimSet As BaselineDimensionSet In oBLDimSets
If oBLDimSet.Style Is oFrom Then
oBLDimSet.Style = oTo
End If
Next
End If
If oCDimSets.Count > 0 Then
For Each oCDimSet As ChainDimensionSet In oCDimSets
If oCDimSet.Style Is oFrom Then
oCDimSet.Style = oTo
End If
Next
End If
If oGenDims.Count > 0 Then
For Each oGenDim As GeneralDimension In oGenDims
If oGenDim.Style Is oFrom Then
oGenDim.Style = oTo
End If
Next
End If
If oODims.Count > 0 Then
For Each oODim As OrdinateDimension In oODims
If oODim.Style Is oFrom Then
oODim.Style = oTo
End If
Next
End If
If oODimSets.Count > 0 Then
For Each oODimSet As OrdinateDimensionSet In oODimSets
If oODimSet.Style Is oFrom Then
oODimSet.Style = oTo
End If
Next
End If
Next
End Sub
If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.
Wesley Crihfield

(Not an Autodesk Employee)