Indexes   

Viewer (Object)

Represents the viewer.
The viewer is the object that makes your objects display on the screen.

Property Index

FullScreen
Returns or sets the state of a viewer to occupy the whole screen.
Height
Returns the viewer's height, in pixels.
Width
Returns the viewer's width, in pixels.

Method Index

Activate
Activates the viewer in the window.
CaptureToFile
Captures the actually displayed scene by the viewer as an image, and stores the image in a file.
GetBackgroundColor
Gets the viewer's background color.
NewCamera
Creates a new camera from the viewpoint of the viewer.
PutBackgroundColor
Sets the viewer's background color.
Reframe
Reframes the viewer's contents (Fits all in).
Update
Updates the viewer's contents.
ZoomIn
Zooms in the viewer's contents.
ZoomOut
Zooms out the viewer's contents.

Properties


o Property FullScreen() As
Returns or sets the state of a viewer to occupy the whole screen.
True if the viewer occupies the whole screen.
Example:
This example retrieves in IsFullScreen whether the MyViewer viewer occupies the whole screen.
 IsFullScreen = MyViewer.FullScreen
 
o Property Height() As (Read Only)
Returns the viewer's height, in pixels.
Example:
This example retrieves the height of the MyViewer viewer.
 h = MyViewer.Height
 
o Property Width() As (Read Only)
Returns the viewer's width, in pixels.
Example:
This example retrieves the width of the MyViewer viewer.
 w = MyViewer.Width
 

Methods


o Sub Activate()
Activates the viewer in the window.
Example:
This example activates Viewers(1) in the window MyWindow.
 MyWindow.Viewers(1).Activate()
 
o Sub CaptureToFile( iFormat,
iFile)
Captures the actually displayed scene by the viewer as an image, and stores the image in a file. Clipped parts of the scene are also clipped in the captured image. Images can be captured as CGM, EMF, TIFF, TIFF Greyscale, BMP, and JPEG images.
Parameters:
iFormat
The format in which the image will be created
iFile
The full pathname of the file into which you want to store the captured image
Example:
This example captures the displayed part of the MyViewer viewer as a BMP image, and stores it in the e:\MyImage.bmp file.
 MyViewer.CaptureToFile catCaptureFormatBMP, "e:\MyImage.bmp" 
 
o Sub GetBackgroundColor( color)
Gets the viewer's background color. The color is expressed in the RGB color mode, as a triplet of coordinates ranging from 0 to 1 for the red, green, and blue colors respectively.
Example:
This example gets the background color of the MyViewer viewer.
 Dim color(2)
 MyViewer.GetBackgroundColor color
 
o Func NewCamera() As
Creates a new camera from the viewpoint of the viewer.
Example:
This example creates the MyCamera new camera by using the current viewpoint of the MyViewer viewer.
 Dim MyCamera As Camera
 Set MyCamera = MyViewer.NewCamera()
 
o Sub PutBackgroundColor( color)
Sets the viewer's background color. The color is expressed in the RGB color mode, as a triplet of coordinates ranging from 0 to 1 for the red, green, and blue colors respectively.
Example:
This example sets the background color of the MyViewer viewer to blue, that is the color with (0.,0.,1.) coordinates
 MyViewer.PutBackgroundColor Array(0, 0, 1)
 
o Sub Reframe()
Reframes the viewer's contents (Fits all in). Reframing means that the viewer's contents is zoomed in or out to enable every object of the scene to be displayed in such a way that most of the space available in the viewer is used, just leaving a thin empty strip around the scene.
Example:
This example reframes the contents of the MyViewer viewer.
 MyViewer.Reframe()
 
o Sub Update()
Updates the viewer's contents. Since the viewer is not automatically updated after a viewpoint modification (for performance reasons), it must be explicitely redrawn when needed.
Example:
This example updates the contents of the MyViewer viewer.
 MyViewer.Update()
 
o Sub ZoomIn()
Zooms in the viewer's contents.
Example:
This example zooms in the contents of the MyViewer viewer.
 MyViewer.ZoomIn()
 
o Sub ZoomOut()
Zooms out the viewer's contents.
Example:
This example zooms out the contents of the MyViewer viewer.
 MyViewer.ZoomOut()
 

Copyright © 2006, Dassault Systèmes. All rights reserved.