Skip to content

Latest commit

 

History

History
76 lines (64 loc) · 1.87 KB

File metadata and controls

76 lines (64 loc) · 1.87 KB

GetUnits

Description

Procedure GetUnits returns the current units settings of the document.

  • Table - Units Formats
Units Format Constant
Decimal 0
Fractional 1
Decimal Ft/Inches 2
Fractional Ft/Inches 3

More extensive Units information is available using the GetPref routines with the selectors shown in the tables of the Scirpt 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