GetProjection View / Zoom 

Declaration:

FUNCTION   GetProjection
( theyLayer:HANDLE ) :INTEGER ;

Description:

Returns the projection index from the specified layer.

Parameters:

theyLayer Layer which the projection is returned for.



  GetVCenter View / Zoom 

Declaration:

PROCEDURE   GetVCenter
( VAR  centerX :REAL;
  VAR  centerY :REAL
) ;

Description:

Procedure GetVCenter returns the Vectorworks document coordinates at the center of the drawing window.

Parameters:

center Returns view center point.

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);



  GetView View / Zoom 

Declaration:

PROCEDURE   GetView
( VAR  xAngleR :REAL;
  VAR  yAngelR :REAL;
  VAR  zAngleR :REAL;
  VAR  offsetX :REAL;
  VAR  offsetY :REAL;
  VAR  offsetZ :REAL
) ;

Description:

Returns information about the current 3D view.

Parameters:

xAngleR Returns X rotation angle of view.
yAngelR Returns Y rotation angle of view.
zAngleR Returns Z rotation angle of view.
offset Center of view rotation.

Example:

PROCEDURE Example;
VAR
	xAngleR, yAngelR, zAngleR, offsetX, offsetY, offsetZ :REAL;
BEGIN
	GetView(xAngleR, yAngelR, zAngleR, offsetX, offsetY, offsetZ);
	Message(xAngleR, ' ', yAngelR, ' ', zAngleR, ' ', offsetX, ' ', offsetY, ' ', offsetZ);
END;
RUN(Example);



  GetZoom View / Zoom 

Declaration:

FUNCTION   GetZoom
:REAL ;

Description:

Function GetZoom returns the percentage of the zoom factor in the current document view.



  Projection View / Zoom 

Declaration:

PROCEDURE   Projection
(   proj :INTEGER;
    rMode :INTEGER;
    viewDistance :REAL;
    clip1X :REAL;
    clip1Y :REAL;
    clip2X :REAL;
    clip2Y :REAL
) ;

Description:

Procedure Projection sets the projection mode of a Vectorworks document.

Parameters viewDistance, clip1, and clip2 are used only in perspective projection mode.

Parameters:

proj Projection mode of document.
rMode Render mode of document.
viewDistance View length.
clip1 Top left coordinate of clipping rectangle.
clip2 Bottom right coordinate of clipping rectangle.

Example:

Projection(1,2,3',-2,-2,2,2);



  SaveSheet View / Zoom 

Declaration:

PROCEDURE   SaveSheet
(   name :STRING;
    saveView :BOOLEAN;
    saveClass :BOOLEAN;
    saveLayer :BOOLEAN
) ;

Description:

Procedure SaveSheet saves current view, page, class, and layer settings in a new sheet with a specified name. The saveView, saveClass and saveLayer parameters can be used to selectively not save an aspect of the view. Also after the sheet is created, the SetObjectVariableBoolean function can be used to control whether to utilize the view, page, class or layer settings.

Parameters:

name Name of saved sheet.
saveView Saves view settings.
saveClass Saves class settings.
saveLayer Saves layer settings.

Example:

PROCEDURE Example;
VAR
	savedViewHandle  :HANDLE;
	ovSheetSaveView	  :BOOLEAN;
	ovSheetSavePage	  :BOOLEAN;
	ovSheetSaveClass :BOOLEAN;
	ovSheetSaveLayer :BOOLEAN;
BEGIN
	savedViewHandle := GetObject('Untitled View');
	IF savedViewHandle <> NIL THEN BEGIN
		ovSheetSaveView  := GetObjectVariableBoolean(savedViewHandle, 450);
		ovSheetSavePage  := GetObjectVariableBoolean(savedViewHandle, 451);
		ovSheetSaveClass := GetObjectVariableBoolean(savedViewHandle, 452);
		ovSheetSaveLayer := GetObjectVariableBoolean(savedViewHandle, 453);
		AlrtDialog(Concat(
			'handle type: ', GetType(savedViewHandle), Chr(13),
			'save view: ',  ovSheetSaveView,  Chr(13),
			'save page: ',  ovSheetSavePage,  Chr(13),
			'save class: ', ovSheetSaveClass, Chr(13),
			'save layer: ', ovSheetSaveLayer));
	END;
END;
RUN(Example);



  SetVCenter View / Zoom 

Declaration:

PROCEDURE   SetVCenter
(   viewCenterX :REAL;
    viewCenterY :REAL
) ;

Description:

Procedure SetVCenter sets the Vectorworks document view center.

Parameters:

viewCenter Coordinates of document view center.

Example:

SetVCenter(2,4);



  SetView View / Zoom 

Declaration:

PROCEDURE   SetView
(   xAngle :REAL;
    yAngle :REAL;
    zAngle :REAL;
    xDistance :REAL;
    yDistance :REAL;
    zDistance :REAL
) ;

Description:

Procedure SetView sets the view of a Vectorworks document. The projection must be non-plan to modify the view.

Parameters:

xAngle X axis rotation angle.
yAngle Y axis rotation angle.
zAngle Z axis rotation angle.
xDistance X coordinate of view center.
yDistance Y coordinate of view center.
zDistance Z coordinate of view center.

Example:

SetView(45d,30d,30d,0,2,2);



  SetViewVector View / Zoom 

Declaration:

PROCEDURE   SetViewVector
(   locationX :REAL;
    locationY :REAL;
    locationZ :REAL;
    targetX :REAL;
    targetY :REAL;
    targetZ :REAL;
    upX :REAL;
    upY :REAL;
    upZ :REAL
) ;

Description:

Sets the view direction of the active document.

Parameters:

location 3D coordinate of view origin.
target 3D coordinate of view target.
up 3D coordinate indicating camera up direction.



  SetZoom View / Zoom 

Declaration:

PROCEDURE   SetZoom
( zoomfactor:LONGINT ) ;

Description:

Procedure SetZoom sets the zoom factor of the active Vectorworks document.

Parameters:

zoomfactor Zoom percentage setting.



  VDelete View / Zoom 

Declaration:

PROCEDURE   VDelete
( name:STRING ) ;

Description:

Procedure VDelete deletes the specified saved view.

Parameters:

name Name of view to be deleted.

Example:

VDelete('Detail A-A');



  VRestore View / Zoom 

Declaration:

PROCEDURE   VRestore
( name:STRING ) ;

Description:

Procedure VRestore restores the specified saved view (i.e., sheet name).

Parameters:

name Name of view to be displayed.



  VSave View / Zoom 

Declaration:

PROCEDURE   VSave
( name:STRING ) ;

Description:

Procedure VSave saves the current Vectorworks document view.

Parameters:

name Name of view to save.