Change Radial to Diametric Style Example (VBA)
This example shows how to change radial style to diametric style.
'-------------------------------------
'
' Preconditions: Radial dimension is selected in the model.
'
' Postconditions: Selected radial dimension is changed
to
' a
diametric dimension.
'
'-------------------------------------
Option Explicit
Sub main()
Dim
swApp As
SldWorks.SldWorks
Dim
swModel As
SldWorks.ModelDoc2
Dim
swSelMgr As
SldWorks.SelectionMgr
Dim
swDispDim As
SldWorks.DisplayDimension
Dim
bRet As
Boolean
Set
swApp = CreateObject("SldWorks.Application")
Set
swModel = swApp.ActiveDoc
Set
swSelMgr = swModel.SelectionManager
Set
swDispDim = swSelMgr.GetSelectedObject5(1)
'
Toggle between radial and diametric styles
If
swDispDim.Diametric Then
swDispDim.Diametric = False
Else
swDispDim.Diametric = True
End
If
'
Redraw to see changes
swModel.GraphicsRedraw2
End Sub