%%PageItemTitle%%

VectorDraw Web Library

JsPropertiesExtractor Send comments on this topic.
AddView Method
See Also  Example
vdWebLibrary Namespace > vdrawObj Class : AddView Method
viewname
The name of the view to be added.
Adds a new view to the document's view collection.

Syntax

JScript 
public function AddView( 
   viewname : String
) : Object;

Parameters

viewname
The name of the view to be added.

Return Value

The created view object or an existing if a view with passed name already exist.

Example

For example we create a new view and we set it active.
C#Copy Code
var view = vdcanvas.AddView("newview"); 
view.ViewRenderMode = vdConst.RENDERMODE_SHADE_GL; 
vdcanvas.SetActiveView(view);

Remarks

If a new view is created then it contains the zoom properties of the active layout.

The return view object contains the following properties.

ViewLayout : the hadle of the reference layout as string

ViewSize : the view size of selected view in drawing units

ViewWorldToViewMatrix : the matrix that defines the 3d view direction

ViewRenderMode : the render mode of the view object.SetRenderMode for valid range values.

ViewCenter : the coordinate of the view center in selected view coordinate system.

ViewPerspectiveMod : the perspective mode of the view object.0 or 1

ViewFocalLength : the Focal length of the view object used when ViewPerspectiveMod is on.

ViewLensAngle : the lens angle in degreees of the view object used when ViewPerspectiveMod is on.

User can change one or more of these properties after the function return.

See Also