pycatia.drafting_interfaces.drawing_sheet

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.drafting_interfaces.drawing_sheet.DrawingSheet(com_object)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)

System.IUnknown
System.IDispatch
System.CATBaseUnknown
System.CATBaseDispatch
System.AnyObject
DrawingSheet

Represents a drawing sheet of the drawing document.

The drawing sheet is included in a drawing document and contains drawing
views.
Warning: This interface is not available with 2D Layout for 3D
Design.
activate() None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub Activate()

Activates the drawing sheet. Activating a drawing sheet means that this
drawing sheet is the one on which the end user is now working. The window in
the application’s window collection which contains this drawing sheet becomes
the active one.

Example:
This example activates the MySheet drawing sheet.

MySheet.Activate
Return type:

None

force_update() None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub ForceUpdate()

Forces the update of all the drawing views of the drawing sheet. This
update redraws all the views, whether their pointed objects have been modified
since the drawing sheet creation or last update or not. These pointed objects
can be CATIA Version 4 models, or CATIA Version 5 parts or
assemblies.
Warning: This method is not available with 2D Layout for 3D
Design.

Example:
This example forces the update of all the drawing views in the MySheet
drawing sheet.

MySheet.ForceUpdate
Return type:

None

property gen_views_pos_mode: int

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property GenViewsPosMode() As CatSheetGenViewsPosMode

Returns or sets the generative views position stability
mode.
Warning: This method is not available with 2D Layout for 3D
Design.

Example:
This example sets the stability mode of the MySheet drawing sheet so
that after an update, existing and unmodified geometries don’t move
globally.

MySheet.GenViewsPosMode = catFixedAxis
Returns:

enum cat_sheet_gen_views_pos_mode

Return type:

int

generate_dimensions() None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub GenerateDimensions()

Generates dimensions in all the drawing views of the drawing sheet. These
dimensions are generated from the constraints of the pointed 3D part(s). One
dimension only is generated for a given constraint. Only dimensions for the
following constraints are generated: distance, length, angle, radius, and
diameter.
Warning: This method is not available with 2D Layout for 3D
Design.

Example:
This example generates the dimensions for all the views in the MySheet
drawing sheet.

MySheet.GenerateDimensions
Return type:

None

get_paper_height() float

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func GetPaperHeight() As double

Gets the paper width of the drawing sheet.

Parameters:

oPaperHeight

Example:
This example get the height of the
DrawingSheet1.

DrawingSheet1.GetPaperHeight oPaperHeight
Return type:

float

get_paper_width() float

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func GetPaperWidth() As double

Gets the paper width of the drawing sheet.

Parameters:

oPaperWidth

Example:
This example get the width of the
DrawingSheet1.

DrawingSheet1.GetPaperWidth oPaperWidth
Return type:

float

is_detail() bool

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func IsDetail() As boolean

Checks whether the sheet is a detail sheet.
Warning: This method is not available with 2D Layout for 3D
Design.
TRUE if the sheet is a detail sheet.

Example:
This example checks whether MySheet is a detail sheet.

IsDetail = MySheet.IsDetail
Return type:

bool

isolate() None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub Isolate()

Isolates the drawing sheet.
Warning: This method is not available with 2D Layout for 3D
Design.

Example:
This example isolates the MySheet drawing sheet.

MySheet.Isolate
Return type:

None

property orientation: int

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property Orientation() As CatPaperOrientation

Returns or sets the paper orientation.

Example:
This example sets the paper orientation for the MySheet drawing sheet
to catPaperLandscape.

MySheet.Orientation = catPaperLandscape
Returns:

enum cat_paper_orientation

Return type:

int

property page_setup: DrawingPageSetup

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property PageSetup() As DrawingPageSetup (Read Only)

Returns the page setup.

Example:
This example returns the page setup for the MySheet drawing
sheet.

Dim MySheetPageSetup As DrawingPageSetup
Set MySheetPageSetup = MySheet.PageSetup
Return type:

DrawingPageSetup

property paper_size: int

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property PaperSize() As CatPaperSize

Returns or sets the paper size.

Example:
This example sets the page size for the MySheet drawing sheet to
catPaperA4.

MySheet.PaperSize = catPaperA4
Returns:

enum cat_paper_size

Return type:

int

property print_area: PrintArea

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property PrintArea() As PrintArea (Read Only)

Returns the print area definition object.

Example:
This example returns the print area for the MySheet drawing
sheet.

Dim MyPrintArea As PrintArea
Set MyPrintArea = MySheet.PrintArea
Return type:

PrintArea

print_out() None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub PrintOut()

Prints the drawing sheet according to its page setup on the default
printer.
Warning: This method is not available with 2D Layout for 3D
Design.

Example:
This example prints the DrawingSheet1 on the default
printer.

DrawingSheet1.PrintOut
Return type:

None

print_to_file(file_name: Path, overwrite=False) None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub PrintToFile(CATBSTR fileName)

Prints the drawing sheet according its page setup in a file instead of
being sent to a printer.

Parameters:

fileName
The full pathname of the file receiving the data.
Warning: This method is not available with 2D Layout for 3D Design.


Example:
This example prints the DrawingSheet1 in a file.

DrawingSheet1.PrintToFile “e://temp//sheet1.prn”
Parameters:
  • file_name (Path) – file_name including full path.

  • overwrite (bool) – Files will not be overwritten unless is True.

Return type:

None

property projection_method: int

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property ProjectionMethod() As CatSheetProjectionMethod

Returns or sets the sheet projection mode .

Example:
This example sets the projection mode of the MySheet drawing sheet to
catFirstAngle.

MySheet.ProjectionMethod = catFirstAngle
Returns:

enum cat_sheet_projection_method

Return type:

int

reorder_views(i_ordered_views: tuple) None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub reorder_Views(CATSafeArrayVariant iOrderedViews)

Changes the positions of the views in this sheet according to the given
ordered list. iOrderedViews is the result of a permutation applied to the list
of all the views of this sheet with the following constraint: the two first
elements of the list must be respectively the sheet’s mainview and background
view.

Example:
This example modifies the views order of a sheet made of a mainview, a
backgroundview and two user-created views. (user-created views are
inverted).

Set drwviewsorder = CATIA.ActiveDocument.Sheets.ActiveSheet
Set drwviews = drwviewsorder.Views
Set mainview = drwviews.item(1)
Set backview = drwviews.item(2)
Set view1 = drwviews.item(3)
Set view2 = drwviews.item(4)
newvieworder = Array(mainview, backview, view2, view1)
drwviewsorder.reorder_Views(newvieworder)
Parameters:

i_ordered_views (tuple) –

Return type:

None

property scale: float

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property Scale() As double

Returns or sets the scale of the drawing sheet.

Example:
This example sets the scale of the MySheet drawing sheet to
0.5.

MySheet.Scale = 0.5
Return type:

float

property scale2: float

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property Scale2() As double

Returns or sets the scale of the drawing sheet (Workaround for VBA
keyword).

Example:
This example sets the scale of the MySheet drawing sheet to
0.5.

MySheet.Scale2 = 0.5
Return type:

float

set_as_detail() None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub SetAsDetail()

Sets the sheet as a detail sheet. You can now create views into this sheet
that will be taken as details. A detail is made to be reuse as dittos in
views.
Warning: This method is not available with 2D Layout for 3D
Design.

Example:
This example changes the MySheet into a detail sheet.

MySheet.SetAsDetail
Return type:

None

set_paper_height(o_paper_height: float) None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub SetPaperHeight(double oPaperHeight)

Sets the paper width of the drawing sheet, available on user
format.

Parameters:

iPaperHeight

Example:
This example set the height of the
DrawingSheet1.

DrawingSheet1.PaperSize = catPaperUser
DrawingSheet1.SetPaperHeight iPaperHeight
Parameters:

o_paper_height (float) –

Return type:

None

set_paper_width(o_paper_width: float) None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub SetPaperWidth(double oPaperWidth)

Sets the paper width of the drawing sheet, available on user
format.

Parameters:

iPaperWidth

Example:
This example set the width of the
DrawingSheet1.

DrawingSheet1.PaperSize = catPaperUser
DrawingSheet1.SetPaperWidth iPaperWidth
Parameters:

o_paper_width (float) –

Return type:

None

update() None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub Update()

Updates the drawing views of the drawing sheet. This update redraws all the
views whose pointed objects have been modified since the drawing sheet creation
or last update, but do not redraw the views whose pointed have not been
modifed. These pointed objects can be CATIA Version 4 models, or CATIA Version
5 parts or assemblies.
Warning: This method is not available with 2D Layout for 3D
Design.

Example:
This example updates the drawing views in the MySheet drawing
sheet.

MySheet.Update
Return type:

None

property views: DrawingViews

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property Views() As DrawingViews (Read Only)

Returns the drawing view collection of the drawing sheet.
Warning: This method is not available with 2D Layout for 3D
Design.

Example:
This example retrieves in ViewCollection the collection of views of the
MySheet drawing sheet.

Dim ViewCollection As DrawingViews
Set ViewCollection = MySheet.Views
Return type:

DrawingViews