AnsweredAssumed Answered

Unit name for volume - swDmUnitsMassPropVolume_e

Question asked by Niels Raahauge on Aug 16, 2018
Latest reply on Aug 17, 2018 by Deepak Gupta

'Hi - Can anybody help me getting parameters from swDmUnitsMassPropVolume_e like this exsample

'BR Niels

 

' This code returns units name for Angle and Length

 

Dim swApp As SldWorks.SldWorks

Dim Part As SldWorks.ModelDoc2

Dim docUserUnitAngle As SldWorks.UserUnit

Dim docUserUnitLength As SldWorks.UserUnit

Dim boolstatus As Boolean

Dim ModelDocExtension As SldWorks.ModelDocExtension

 

Option Explicit

 

Sub main()

 

    Set swApp = Application.SldWorks

    Set Part = swApp.ActiveDoc

    Set ModelDocExtension = Part.Extension

    Set docUserUnitAngle = Part.GetUserUnit(swAngleUnit)

    Set docUserUnitLength = Part.GetUserUnit(swLengthUnit)

 

    Debug.Print "  Full units name: " & docUserUnitAngle.GetFullUnitName(True)

    Debug.Print "  Full units name: " & docUserUnitLength.GetFullUnitName(True)

 

End Sub

Outcomes