Skip to content

Latest commit

 

History

History
86 lines (74 loc) · 1.92 KB

File metadata and controls

86 lines (74 loc) · 1.92 KB

GetUnits

Description

Procedure GetUnits returns the current units settings of the document.

{| class="wikitable_c" |+ Table - Units Formats ! Units Format

! Constant
Decimal
style="text-align:center"
-
Fractional
style="text-align:center"
-
Decimal Ft/Inches
style="text-align:center"
-
Fractional Ft/Inches
style="text-align:center"
}

More extensive Units information is available using the [[VS:GetPref]] routines with the selectors shown in the tables of the [[VS:Function Reference Appendix#Primary Units Selectors|VectorScript Appendix]].

PROCEDURE GetUnits(
				VAR fraction   : LONGINT;
				VAR display    : LONGINT;
				VAR format     : INTEGER;
				VAR upi        : REAL;
				VAR name       : STRING;
				VAR squareName : STRING);
def vs.GetUnits():
    return (fraction, display, format, upi, name, squareName)

Parameters

Name Type Description
fraction LONGINT Approximate WorldCoords per drawing unit. Use GetPrefReal(150) instead.
display LONGINT Returns display accuracy.
format INTEGER Returns units format setting.
upi REAL Returns units per inch value.
name STRING Returns unit mark.
squareName STRING Returns square unit mark.

Remarks

Another way to get the UPI is to use: UPI := GetPrefReal(152);

Examples

==== VectorScript ====

PROCEDURE Example;
VAR 
fraction   :LONGINT; 
display    :LONGINT; 
format     :INTEGER; 
upi        :REAL; 
name       :STRING;
squareName :STRING;
BEGIN
GetUnits(fraction, display, format, upi, name, squareName);
Message(fraction, ' ', display, ' ', format, ' ', upi, ' ', name, ' ', squareName);
END;
RUN(Example);

==== Python ====

def Example():
	fraction, display, format, upi, name, squareName = vs.GetUnits()
	vs.Message(fraction, ' ', display, ' ', format, ' ', upi, ' ', name, ' ', squareName)

Example()

Version

Availability: from All Versions

Category

  • Units