VS:GetRoundingBase/ja

From Vectorworks Developer
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

主単位、寸法(主単位)、寸法(補助単位)の端数丸めの基準(1、2.5、5)を返します。

PROCEDURE GetRoundingBase(
VAR display :INTEGER;
VAR primary :INTEGER;
VAR secondary :INTEGER);
def vs.GetRoundingBase():
    return (display, primary, secondary)

Parameters

display INTEGER 主単位
primary INTEGER 寸法(主単位)
secondary INTEGER 寸法(補助単位)

Example

FUNCTION DisplayAccuracy :REAL;
VAR
	dec_prec  :REAL;
	frac_prec :REAL;
	display   :INTEGER; 
	primary   :INTEGER; 
	secondary :INTEGER;
BEGIN
	GetRoundingBase(display, primary, secondary);
	dec_prec := 1 / (10 ^ GetPrefLongInt(169));
	IF display = 1 THEN dec_prec := dec_prec * 2.5 ELSE
	IF display = 2 THEN dec_prec := dec_prec * 5;
	frac_prec := 1 / (2 ^ GetPrefLongInt(171));
	IF NOT  GetPref(168) THEN DisplayAccuracy := dec_prec
	ELSE IF GetPref(175) THEN DisplayAccuracy := Min(dec_prec, frac_prec)
	ELSE DisplayAccuracy := frac_prec;
END;

Version

利用可能バージョン: VectorWorks10.0