Table of Contents

Method AddView

Namespace
vdWebLibrary
Assembly
JsPropertiesExtractor.dll

AddView(string)

Adds a new view to the document's view collection.

public object AddView(string viewname)

Parameters

viewname string

The name of the view to be added.

Returns

object

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

Examples

For example we create a new view and we set it active.

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.