Change Standard Style of Dimension

Change Standard Style of Dimension

18154093
Contributor Contributor
267 Views
1 Reply
Message 1 of 2

Change Standard Style of Dimension

18154093
Contributor
Contributor

Hi all

I have a trouble about standard style of dimension

How can I get standard style of dimension by ilogic

Anyone has idea for this

Thanks all

0 Likes
268 Views
1 Reply
Reply (1)
Message 2 of 2

tyler.warner
Advocate
Advocate

Here's a sample for switching the style or creating a new one.

 

Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oDimStyle As DimensionStyle
Try 'Try to activate a specific style from your library.
	oDimStyle = oDoc.StylesManager.DimensionStyles.Item("NewStyleName")
Catch 'Create the style if it doesn't exist.
	oDimStyle = oDoc.StylesManager.DimensionStyles.Item("ExistingStyleName").Copy("NewStyleName")
End Try 'Change format of selected style.
'oDimStyle.AlternateDisplayUnitType = True
'oDimStyle.AlternateLinearUnits = kMillimeterLengthUnits
'oDimStyle.AlternateLinearPrecision = kOneDecimalPlaceLinearPrecision
'oDimStyle.VerticalDimensionTextOrientation = kInlineAlignedDimensionText

Dim oSheet = ThisDrawing.ActiveSheet '.ItemByName("Sheet:1")
Dim oView = oSheet.DrawingViews.ItemByName("oView")
Dim genDims = oSheet.DrawingDimensions.GeneralDimensions

Dim namedGeometry1 = oView.GetIntent("Top Face")
Dim namedGeometry2 = oView.GetIntent("Bottom Face")

Dim linDim1 = genDims.AddLinear("Dimension 2", oView.SheetPoint(1.125, 0), namedGeometry1, namedGeometry2)
linDim1.NativeEntity.Style = oDimStyle
If this solved your problem or answered your question, please click ACCEPT SOLUTION.
If this helped you, please click LIKE.
0 Likes