This worked sell to change a drawing dimension from imperialdisplay to metric (MM) display (Thank you SolidAir!)
Dim swSelMgr As SldWorks.SelectionMgr
Dim swDisplayDim As SldWorks.DisplayDimension
Dim Part As ModelDoc2
Set Part = swApp.ActiveDoc
...
...
...
If Me.optMetricYes.Value = True Then
Set swSelMgr = Part.SelectionManager
RetVal = Part.SelectByID("RD2@Drawing View7", "DIMENSION", 0, 0,0)
Set swDisplayDim = swSelMgr.GetSelectedObject6(1, -1)
RetVal = swDisplayDim.SetUnits(False, swMM, swDECIMAL, 3, True)
End If
BUT silly me I thought the "3" in
RetVal = swDisplayDim.SetUnits(False, swMM, swDECIMAL, 3, True)
would give me three decimal places but it does not. What is theright way to do it?
Thanx,
plh
SolidworksApi macros







Dim swSelMgr As SldWorks.SelectionMgr
Dim swDisplayDim As SldWorks.DisplayDimension
Dim Part As ModelDoc2
Set Part = swApp.ActiveDoc
...
...
...
If Me.optMetricYes.Value = True Then
Set swSelMgr = Part.SelectionManager
RetVal = Part.SelectByID("RD2@Drawing View7", "DIMENSION", 0, 0,0)
Set swDisplayDim = swSelMgr.GetSelectedObject6(1, -1)
RetVal = swDisplayDim.SetUnits(False, swMM, swDECIMAL, 3, True)
End If
BUT silly me I thought the "3" in
RetVal = swDisplayDim.SetUnits(False, swMM, swDECIMAL, 3, True)
would give me three decimal places but it does not. What is theright way to do it?
Thanx,
plh
SolidworksApi macros
