VS:GetPrimaryUnitInfo: Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
m (Simple code formatting) |
||
Line 82: | Line 82: | ||
CASE major of | CASE major of | ||
8: Case style of | 8: Case style of | ||
0: AlrtDialog('Custom'); | 0: AlrtDialog('Custom'); | ||
1: AlrtDialog('Old Style Feet/Inches'); | 1: AlrtDialog('Old Style Feet/Inches'); | ||
2: AlrtDialog('Millimeter'); | 2: AlrtDialog('Millimeter'); | ||
3: AlrtDialog('Centimeter'); | 3: AlrtDialog('Centimeter'); | ||
4: AlrtDialog('Inches'); | 4: AlrtDialog('Inches'); | ||
5: AlrtDialog('Meters'); | 5: AlrtDialog('Meters'); | ||
6: AlrtDialog('Feet/Inches'); | 6: AlrtDialog('Feet/Inches'); | ||
7: AlrtDialog('Feet'); | 7: AlrtDialog('Feet'); | ||
END; | END; | ||
9..11: Case style of | 9..11: Case style of | ||
0: AlrtDialog('Custom'); | 0: AlrtDialog('Custom'); | ||
1: AlrtDialog('Feet/Inches'); | 1: AlrtDialog('Feet/Inches'); | ||
2: AlrtDialog('Feet'); | 2: AlrtDialog('Feet'); | ||
3: AlrtDialog('Inches'); | 3: AlrtDialog('Inches'); | ||
4: AlrtDialog('Millimeters'); | 4: AlrtDialog('Millimeters'); | ||
5: AlrtDialog('Centimeters'); | 5: AlrtDialog('Centimeters'); | ||
6: AlrtDialog('Meters'); | 6: AlrtDialog('Meters'); | ||
END; | END; | ||
12: Case style of | 12: Case style of | ||
1: AlrtDialog('Feet and Inches'); | 1: AlrtDialog('Feet and Inches'); | ||
2: AlrtDialog('Inches'); | 2: AlrtDialog('Inches'); | ||
3: AlrtDialog('Feet'); | 3: AlrtDialog('Feet'); | ||
4: AlrtDialog('Yards'); | 4: AlrtDialog('Yards'); | ||
5: AlrtDialog('Miles'); | 5: AlrtDialog('Miles'); | ||
6: AlrtDialog('Microns'); | 6: AlrtDialog('Microns'); | ||
7: AlrtDialog('Millimeters'); | 7: AlrtDialog('Millimeters'); | ||
8: AlrtDialog('Centimeters'); | 8: AlrtDialog('Centimeters'); | ||
9: AlrtDialog('Meters'); | 9: AlrtDialog('Meters'); | ||
10: AlrtDialog('Kilometers'); | 10: AlrtDialog('Kilometers'); | ||
11: AlrtDialog('Degrees'); | 11: AlrtDialog('Degrees'); | ||
END; | END; | ||
END; | END; |
Latest revision as of 21:26, 2 February 2023
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Procedure GetPrimaryUnitInfo returns the primary units settings for the active document.
PROCEDURE GetPrimaryUnitInfo(
VAR style :INTEGER;
VAR prec :LONGINT;
VAR dimPrec :LONGINT;
VAR format :INTEGER;
VAR angPrec :INTEGER;
VAR showMark :BOOLEAN;
VAR dispFrac :BOOLEAN);
def vs.GetPrimaryUnitInfo(): return (style, prec, dimPrec, format, angPrec, showMark, dispFrac)
Parameters
style INTEGER Returns active primary units style. prec LONGINT Returns display precision. dimPrec LONGINT Returns dimension precision. format INTEGER Returns decimal formatting. angPrec INTEGER Returns angular precision. showMark BOOLEAN Returns unit mark display setting. dispFrac BOOLEAN Returns fractional display setting.
Remarks
Returns settings information for primary units.
Example
VectorScript
PROCEDURE Example; VAR style :INTEGER; prec, dimPrec :LONGINT; format, angPrec :INTEGER; showMark, dispFrac :BOOLEAN; major, minor, maintenance, platform :INTEGER; BEGIN GetVersion(major, minor, maintenance, platform); GetPrimaryUnitInfo(style, prec, dimPrec, format, angPrec, showMark, dispFrac); CASE major of 8: Case style of 0: AlrtDialog('Custom'); 1: AlrtDialog('Old Style Feet/Inches'); 2: AlrtDialog('Millimeter'); 3: AlrtDialog('Centimeter'); 4: AlrtDialog('Inches'); 5: AlrtDialog('Meters'); 6: AlrtDialog('Feet/Inches'); 7: AlrtDialog('Feet'); END; 9..11: Case style of 0: AlrtDialog('Custom'); 1: AlrtDialog('Feet/Inches'); 2: AlrtDialog('Feet'); 3: AlrtDialog('Inches'); 4: AlrtDialog('Millimeters'); 5: AlrtDialog('Centimeters'); 6: AlrtDialog('Meters'); END; 12: Case style of 1: AlrtDialog('Feet and Inches'); 2: AlrtDialog('Inches'); 3: AlrtDialog('Feet'); 4: AlrtDialog('Yards'); 5: AlrtDialog('Miles'); 6: AlrtDialog('Microns'); 7: AlrtDialog('Millimeters'); 8: AlrtDialog('Centimeters'); 9: AlrtDialog('Meters'); 10: AlrtDialog('Kilometers'); 11: AlrtDialog('Degrees'); END; END; END; RUN(Example);
Python
def Example(): major, minor, maintenance, platform = vs.GetVersion() style, prec, dimPrec, format, angPrec, showMark, dispFrac = vs.GetPrimaryUnitInfo() if major == 8: if style == 0: vs.AlrtDialog('Custom') elif style == 1: vs.AlrtDialog('Old Style Feet/Inches') elif style == 2: vs.AlrtDialog('Millimeter') elif style == 3: vs.AlrtDialog('Centimeter') elif style == 4: vs.AlrtDialog('Inches') elif style == 5: vs.AlrtDialog('Meters') elif style == 6: vs.AlrtDialog('Feet/Inches') elif style == 7: vs.AlrtDialog('Feet') elif major >= 9 and major <= 11: if style == 0: vs.AlrtDialog('Custom') elif style == 1: vs.AlrtDialog('Feet/Inches') elif style == 2: vs.AlrtDialog('Feet') elif style == 3: vs.AlrtDialog('Inches') elif style == 4: vs.AlrtDialog('Millimeters') elif style == 5: vs.AlrtDialog('Centimeters') elif style == 6: vs.AlrtDialog('Meters') elif major == 12: if style == 1: vs.AlrtDialog('Feet and Inches') elif style == 2: vs.AlrtDialog('Inches') elif style == 3: vs.AlrtDialog('Feet') elif style == 4: vs.AlrtDialog('Yards') elif style == 5: vs.AlrtDialog('Miles') elif style == 6: vs.AlrtDialog('Microns') elif style == 7: vs.AlrtDialog('Millimeters') elif style == 8: vs.AlrtDialog('Centimeters') elif style == 9: vs.AlrtDialog('Meters') elif style == 10: vs.AlrtDialog('Kilometers') elif style == 11: vs.AlrtDialog('Degrees') Example()
Version
Availability: from VectorWorks8.0
See Also
VS Functions:
VS Functions:
[[VS:GetRoundingBase]]