pycatia.in_interfaces.viewer

Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-06-11 12:40:47.360445

Warning

The notes denoted “CAA V5 Visual Basic Help” are to be used as reference only. They are there as a guide as to how the visual basic / catscript functions work and thus help debugging in pycatia.

class pycatia.in_interfaces.viewer.Viewer(com_object)

Note

CAA V5 Visual Basic Help (2020-07-06 14:02:20.222384)

System.IUnknown
System.IDispatch
System.CATBaseUnknown
System.CATBaseDispatch
System.AnyObject
Viewer

Represents the viewer.
The viewer is the object that makes your objects display on the
screen.
activate() None

Note

CAA V5 Visual Basic Help (2020-07-06 14:02:20.222384))
o Sub Activate()

Activates the viewer in the window.

Example:
This example activates Viewers(1) in the window
MyWindow.

MyWindow.Viewers(1).Activate()
Return type:

None

capture_to_file(i_format: int, i_file: str) None

Note

CAA V5 Visual Basic Help (2020-07-06 14:02:20.222384))
o Sub CaptureToFile(CatCaptureFormat iFormat,
CATBSTR 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”
Parameters:
  • i_format (int) – enum cat_capture_format

  • i_file (str) –

Return type:

None

property full_screen: bool

Note

CAA V5 Visual Basic Help (2020-07-06 14:02:20.222384)
o Property FullScreen() As boolean

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
Return type:

bool

get_background_color() tuple

Note

CAA V5 Visual Basic Help (2020-07-06 14:02:20.222384))
o Sub GetBackgroundColor(CATSafeArrayVariant 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
Return type:

tuple

property height: int

Note

CAA V5 Visual Basic Help (2020-07-06 14:02:20.222384)
o Property Height() As long (Read Only)

Returns the viewer’s height, in pixels.

Example:
This example retrieves the height of the MyViewer
viewer.

h = MyViewer.Height
Return type:

int

new_camera() Camera

Note

CAA V5 Visual Basic Help (2020-07-06 14:02:20.222384))
o Func NewCamera() As Camera

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()
Return type:

Camera

put_background_color(color: tuple) None

Note

CAA V5 Visual Basic Help (2020-07-06 14:02:20.222384))
o Sub PutBackgroundColor(CATSafeArrayVariant 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)
Parameters:

color (tuple) –

Return type:

None

reframe() None

Note

CAA V5 Visual Basic Help (2020-07-06 14:02:20.222384))
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()
Return type:

None

update() None

Note

CAA V5 Visual Basic Help (2020-07-06 14:02:20.222384))
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()
Return type:

None

property width: int

Note

CAA V5 Visual Basic Help (2020-07-06 14:02:20.222384)
o Property Width() As long (Read Only)

Returns the viewer’s width, in pixels.

Example:
This example retrieves the width of the MyViewer
viewer.

w = MyViewer.Width
Return type:

int

zoom_in() None

Note

CAA V5 Visual Basic Help (2020-07-06 14:02:20.222384))
o Sub ZoomIn()

Zooms in the viewer’s contents.

Example:
This example zooms in the contents of the MyViewer
viewer.

MyViewer.ZoomIn()
Return type:

None

zoom_out() None

Note

CAA V5 Visual Basic Help (2020-07-06 14:02:20.222384))
o Sub ZoomOut()

Zooms out the viewer’s contents.

Example:
This example zooms out the contents of the MyViewer
viewer.

MyViewer.ZoomOut()
Return type:

None