Difference between revisions of "VS:GetVCenter/ja"

From Vectorworks Developer
Jump to: navigation, search
m (1 revision)
 
m (1 revision)
 

Latest revision as of 09:33, 12 August 2013

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


Description

ドキュメントウインドウで表示されている中心の座標を返します。
PROCEDURE GetVCenter(
VAR center  :REAL);
def vs.GetVCenter():
    return center

Parameters

center REAL 中心の座標

Example

PROCEDURE GetWindowSizeProc;
CONST
	kLeftPaletteMargin    = 54;
	kRightPaletteMargin   = 176;
	kScrollMargin         = 18;
	kTopDocumentMargin    = 48;
	kRulerMargin          = 16;
	kBottomDocumentMargin = 50;
VAR
	ViewCenterX, ViewCenterY       :REAL;
	ViewWidth, ViewHeight          :REAL;
	ScnX1, ScnY1, ScnX2, ScnY2     :REAL;
	ViewX1, ViewY1, ViewX2, ViewY2 :REAL;
	LayerScale                     :REAL;
	TopBottomMargin                :REAL;
	LeftRightMargin                :REAL;
BEGIN
	LayerScale := GetLScale(ActLayer);
	GetVCenter(ViewCenterX, ViewCenterY);
	GetScreen(ScnX1, ScnY1, ScnX2, ScnY2);
	TopBottomMargin := kTopDocumentMargin + kBottomDocumentMargin;
	LeftRightMargin := 0;
	IF GetPref(22) THEN BEGIN {Left Palette Margin Turned On}
		LeftRightMargin := LeftRightMargin + kLeftPaletteMargin;
	END;
	IF GetPref(23) THEN BEGIN {Right Palette Margin Turned On}
		LeftRightMargin := LeftRightMargin + kRightPaletteMargin;
	END;
	IF GetPref(6) THEN BEGIN {Show Rulers}
		TopBottomMargin := TopBottomMargin + kRulerMargin;
		LeftRightMargin := LeftRightMargin + kRulerMargin;
	END;
	IF GetPref(7) THEN BEGIN {Show Scroll Bars}
		TopBottomMargin := TopBottomMargin + kScrollMargin;
		LeftRightMargin := LeftRightMargin + kScrollMargin;
	END;
	ViewWidth  := (ScnX2 - LeftRightMargin) * LayerScale / (72 * GetZoom / 100);
	ViewHeight := (ScnY2 - TopBottomMargin) * LayerScale / (72 * GetZoom / 100);
	ViewX1 := ViewCenterX - (ViewWidth  / 2) {+ (LeftRightMargin / 2)};
	ViewX2 := ViewCenterX + (ViewWidth  / 2) {- (LeftRightMargin / 2)};
	ViewY1 := ViewCenterY + (ViewHeight / 2) {- (TopBottomMargin / 2)};
	ViewY2 := ViewCenterY - (ViewHeight / 2) {+ (TopBottomMargin / 2)};
	Rect(ViewX1, ViewY1, ViewX2, ViewY2);
END;
RUN(GetWindowSizeProc);

Version

利用可能バージョン: VectorWorks8.0
Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox
In other languages