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)| 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. |
Another way to get the UPI is to use: UPI := GetPrefReal(152);
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);def Example():
fraction, display, format, upi, name, squareName = vs.GetUnits()
vs.Message(fraction, ' ', display, ' ', format, ' ', upi, ' ', name, ' ', squareName)
Example()Availability: from All Versions