Get Chamfer Dimension Example (VBA)
This example shows how to the values of the selected chamfer dimension.
'--------------------------------------
'
' Preconditions:
' (1)
Drawing document is open.
' (2)
Chamfer dimension is selected.
'
' Postconditions: NOne
'
'---------------------------------------
Option Explicit
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swSelMgr As SldWorks.SelectionMgr
Dim swDim As SldWorks.Dimension
Dim swDisplayDim As SldWorks.DisplayDimension
Dim length As Double
Dim angle As Double
Dim retval As Variant
Sub main()
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swSelMgr = swModel.SelectionManager
Set swDisplayDim = swSelMgr.GetSelectedObject6(1,
0)
Set swDim = swDisplayDim.GetDimension
retval = swDim.GetSystemChamferValues(length,
angle)
Debug.Print "Is selected dimension a chamfer dimension?
" & retval
Debug.Print "Length = " & length
Debug.Print "Angle = " & angle
End Sub