Sets the units used by the end-user for the model.
.NET Syntax
Visual Basic (Usage) | |
---|
Dim instance As IModelDoc2
Dim UType As System.Short
Dim FractBase As System.Short
Dim FractDenom As System.Short
Dim SigDigits As System.Short
Dim RoundToFraction As System.Boolean
instance.SetUnits(UType, FractBase, FractDenom, SigDigits, RoundToFraction) |
Parameters
- UType
- Model units as defined in swLengthUnit_e
- FractBase
Decimal or fraction as defined in swFractionDisplay_e
- FractDenom
Denominator of the smallest inch fraction to be used, for example, 64 for 1/64; valid only if FractBase is set to swFRACTION (see Remarks)
- SigDigits
Significant digits; valid only if FractBase is set to swDECIMAL
- RoundToFraction
Flag denoting whether or not to round to the fraction; for example, if 4 is the denominator value given in FractDenom and the actual value is 0.27, it is rounded to 0.25
Example
' VBA
' 1. Open a document in SOLIDWORKS.
' 2. Run the macro below to set inch units with
' a fractional base of 16 and no rounding.
Dim swApp As SldWorks.SldWorks
Dim Part As SldWorks.ModelDoc2
Option Explicit
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Part.SetUnits swINCHES, swFRACTION, 16, 0, False
End Sub
Example
Remarks
See Also
Availability
SOLIDWORKS 2001Plus FCS, Revision Number 10.0