pycatia.drafting_interfaces.drawing_table

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_table.DrawingTable(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
DrawingTable

Represents a drawing table in a drawing view.
add_column(i_col: int) None

Note

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

Adds a column before the indicated column.

Parameters:

iCol
The column before which the new column will be
inserted

Example:
This example adds a column after the last one of the drawing
table MyTable.

iCol = 0
MyTable.AddColumn iCol
Parameters:

i_col (int) –

Return type:

None

add_row(i_row: int) None

Note

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

Adds a row before the indicated row.

Parameters:

iRow
The row before which the new row will be inserted

Example:
This example adds a row beetween the first row and the second
row of the drawing table MyTable.

iRow = 2
MyTable.AddRow iRow
Parameters:

i_row (int) –

Return type:

None

property anchor_point: int

Note

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

Returns or sets the anchor point of a drawing table.

Parameters:

iMode
The invert mode to apply

Example:
This example sets the anchor point of the drawing table MyTable
to bottom left.

MyTable.AnchorPoint = CatTableBottomLeft
Returns:

enum cat_table_position

Return type:

int

property angle: float

Note

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

Returns or sets the angle orientation of a drawing table.

Example:
This example sets the orientation of the table MyTable to
vertical.

PI = 3.1415926535
X = MyTable.Angle = PI/2
Return type:

float

property compute_mode: int

Note

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

Returns or sets the compute mode of a drawing table. If the compute mode is
set to OFF, no display of the modifications applied to a table will be
computed. This allows to save much time when executing a macro. To displayed
the table, set the compute mode back to ON.

Example:
This example sets the compute mode of the drawing table MyTable to
OFF.

MyTable.ComputeMode = CatTableOFF
Returns:

enum cat_table_compute_mode

Return type:

int

get_cell_alignment(i_row: int, i_col: int) int

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func GetCellAlignment(long iRow,
long iCol) As CatTablePosition

Retrieves the alignment of the pointed cell of a drawing
table.

Parameters:

iRow
The cell row
iCol
The cell column
oAlign
The alignment type of the cell

Example:
This example retrieves the alignment of the cell (1,3) of the
table MyTable.

iRow = 1
iCol = 3
oAlign = MyTable.GetCellAlignment(iRow, iCol)
Parameters:
  • i_row (int) –

  • i_col (int) –

Returns:

enum cat_table_position

Return type:

int

get_cell_border_type(i_row: int, i_col: int) int

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func GetCellBorderType(long iRow,
long iCol) As CatTableBorderType

Retrieves the drawing text contained in the cell of a drawing
table.

Parameters:

iRow
The cell row
iCol
The cell column
oType
The type of the cell border

Example:
This example retrieves the border type of the cell (1, 3) of
the drawing table MyTable.

iRow = 1
iCol = 3
oType = MyTable.GetCellBorderType(iRow, iCol)
!!!! WARNING oType is not defined as the enum does but as it
is documented in the SetCellBorderType method
if oType == 15 it means border is set to left, top, right and
bottom.
if oType == 8 it means border is set to bottom.
Parameters:
  • i_row (int) –

  • i_col (int) –

Returns:

enum cat_table_border_type

Return type:

int

get_cell_name(i_row: int, i_col: int) str

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func GetCellName(long iRow,
long iCol) As CATBSTR

Returns the name of a table cell.

Parameters:

iRow
The cell row
iCol
The cell column
oName
The cell name

Example:
This example returns the name of the cell (1,2) of the table
MyTable.

iRow = 1
iCol = 2
oName = MyTable.GetCellName(iRow, iCol)
Parameters:
  • i_row (int) –

  • i_col (int) –

Return type:

str

get_cell_object(i_row: int, i_col: int) DrawingText

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func GetCellObject(long iRow,
long iCol) As DrawingText

Retrieves the object contained in the cell of a drawing
table.

Parameters:

iRow
The cell row
iCol
The cell column
oText
The object contained in the cell : this object only supports font properties, color, line
spacing, Super/Sub script. Do not use position and/or orientation properties on this
object, it is useless.

Example:
This example retrieves the drawing text MyText of the cell
(1,3) of the table MyTable.

iRow = 1
iCol = 3
Set MyText = MyTable.GetCellObject(iRow, iCol)
Parameters:
  • i_row (int) –

  • i_col (int) –

Return type:

DrawingText

get_cell_string(i_row: int, i_col: int) str

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func GetCellString(long iRow,
long iCol) As CATBSTR

Returns the string contained in the cell of a drawing
table.

Parameters:

iRow
The cell row
iCol
The cell column
oString
The string contained in the cell

Example:
This example returns the string contained in the cell (1,4) of
the table MyTable.

iRow = 1
iCol = 4
oString = MyTable.GetCellString(iRow, iCol)
Parameters:
  • i_row (int) –

  • i_col (int) –

Returns:

str

get_cells_merge(o_list_of_merge_cells: tuple) None

Note

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

Returns the merge cells.

Parameters:

oListOfMergeCells
@param oListOfMergeCells List of merge cells.

Example:
This example returns the merge cells of the drawing table
MyTable.

nbrow = MyTable.NumberOfRows
nbcol = MyTable.NumberOfColumns
sizetab = nbrow*nbcol
ReDim infoMerge (sizetab-1)
MyTable.GetCellsMerge(oListOfmergeCells)
Parameters:

o_list_of_merge_cells (tuple) –

Return type:

None

get_column_size(i_col: int) float

Note

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

Returns the width of a column of a drawing table.

Parameters:

iCol
The cell column
oColSize
The cell width in mm. It corresponds to the size of the widest cell
of the column or at least the size set with
CATIADrawingTable::SetColumnSize.

Example:
This example returns the width of the column (1) of the drawing
table MyTable.

iCol = 1
oColSize = MyTable.GetColumnSize(iCol)
Parameters:

i_col (int) –

Return type:

float

get_merge_infos(i_row: int, i_col: int, o_first_row: int, o_first_col: int, o_nb_row: int, o_nb_col: int) None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub GetMergeInfos(long iRow,
long iCol,
long oFirstRow,
long oFirstCol,
long oNbRow,
long oNbCol)

Returns informations about a group of merge cells from a
cell.

Parameters:

iRow
@param iCol cell of merge
iFirstRow
Row of the first cell of the group Column of the first cell of the
group
iNbRowMerge
Number of rows of the group
iNbColMerge
Number of columns of the group

Example:
This example returns informations of a group of merge cells
from cell (2, 3) of the drawing table MyTable.

MyTable.GetMergeInfos 2, 3, oFirstRow, oFirstCol, oNbRow,
oNbCol
Parameters:
  • i_row (int) –

  • i_col (int) –

  • o_first_row (int) –

  • o_first_col (int) –

  • o_nb_row (int) –

  • o_nb_col (int) –

Return type:

None

get_row_size(i_row: int) float

Note

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

Returns the height of a row of a drawing table.

Parameters:

iRow
The cell row
oRowSize
The cell height in mm. It corresponds to the size of the highest
cell of the row or at least the size set with
CATIADrawingTable::SetRowsize.

Example:
This example returns the height of the row (1) of the drawing
table MyTable.

iRow = 1
oRowSize = MyTable.GetRowSize(iRow)
Parameters:

i_row (int) –

Return type:

float

invert_mode(i_mode: int) None

Note

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

Sets a mode of table inversion.

Example:
This example swaps the columns of the drawing table
MyTable.

MyTable.InvertMode CatInvertColumn
Parameters:

i_mode (int) – enum cat_table_invert_mode

Return type:

None

property leaders: DrawingLeaders

Note

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

Returns the drawing leader collection of the drawing
table.

Example:
This example retrieves in LeaderCollection the collection of leaders of
the MyTable drawing table.

Dim LeaderCollection As DrawingLeaders
Set LeaderCollection = MyTable.Leaders
Return type:

DrawingLeaders

merge_cells(i_first_row, i_first_col, i_nb_row_merge, i_nb_col_merge)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub MergeCells(long iFirstRow,
long iFirstCol,
long iNbRowMerge,
long iNbColMerge)

Merges a group of cells.

Parameters:

iFirstRow
@param iFirstCol First cell of merge
iNbRowMerge
Number of rows to merge
iNbColMerge
Number of columns to merge

Example:
This example merges cells from cell (2, 3) to cell (4, 5) of
the drawing table MyTable.

MyTable.MergeCells 2, 3, 3, 3
Parameters:
  • i_first_row (int) –

  • i_first_col (int) –

  • i_nb_row_merge (int) –

  • i_nb_col_merge (int) –

Return type:

None

move(i_delta_x: float, i_delta_y: float) None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub Move(double iDeltaX,
double iDeltaY)

Moves the table relatively to its original position.

Parameters:

iDeltaX
The X deviation
ideltaY
The Y deviation

Example:
This example moves the table MyTable to 20mm in
X.

DeltaX = 20.0
DeltaY = 0.0
MyTable.Move DeltaX, DeltaY
Parameters:
  • i_delta_x (float) –

  • i_delta_y (float) –

Return type:

None

property number_of_columns: int

Note

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

Returns the number of columns of a drawing table.

Example:
This example returns the number of columns of the drawing table
MyTable.

oNbCol = MyTable.NumberOfColumns
Return type:

int

property number_of_rows: int

Note

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

Returns the number of rows of a drawing table.

Example:
This example returns the number of rows of the drawing table
MyTable.

oNbRow = MyTable.NumberOfRows
Return type:

int

remove_column(i_col: int) None

Note

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

Removes the indicated column.

Parameters:

iCol
The column to remove

Example:
This example removes the first column of the drawing table
MyTable.

iCol = 1
MyTable.RemoveColumn iCol
Parameters:

i_col (int) –

Return type:

None

remove_row(i_row)

Note

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

Removes the indicated row.

Parameters:

iRow
The row to remove

Example:
This example removes the third row of the drawing table
MyTable.

iRow = 3
MyTable.RemoveRow iRow
Parameters:

i_row (int) –

Return type:

None

rotate(i_delta_angle: float) None

Note

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

Rotates the table relatively to its original position.

Parameters:

iDeltaAngle
The angle of rotation from the current position

Example:
This example rotates the table MyTable to 45
degrees.

PI = 3.1415926535
MyTable.Rotate PI/4
Parameters:

i_delta_angle (float) –

Return type:

None

set_cell_alignment(i_row: int, i_col: int, i_align: int) None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub SetCellAlignment(long iRow,
long iCol,
CatTablePosition iAlign)

Sets the pointed cell alignment of a drawing table.

Parameters:

iRow
The cell row
iCol
The cell column
iAlign
The type of alignment to be applied

Example:
This example sets the cell (3,2) alignment of the table MyTable
to bottom left.

iRow = 3
iCol = 2
MyTable.SetCellAlignment iRow, iCol,
CatTableBottomLeft
Parameters:
  • i_row (int) –

  • i_col (int) –

  • i_align (int) – enum cat_table_position

Return type:

None

set_cell_border_type(i_row: int, i_col: int, i_type: int) None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub SetCellBorderType(long iRow,
long iCol,
long iType)

Sets the pointed cell border type of a drawing table.

Parameters:

iRow
The cell row
iCol
The cell column
iType
The type of border to be applied

Example:
This example sets the cell (3,2) border type of the table
MyTable to right and left. (1+4)

iRow = 3
iCol = 2
MyTable.SetCellBorderType iRow, iCol, 5


Example:
This example sets the cell (1,1) border type of the table MyTable to all border out
line (left, top, right and bottom). (1+2+4+8 = 15)

iRow = 3
iCol = 2
MyTable.SetCellBorderType iRow, iCol, 15
Parameters:
  • i_row (int) –

  • i_col (int) –

  • i_type (int) –

Return type:

None

set_cell_name(i_row: int, i_col: int, i_name: str) None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub SetCellName(long iRow,
long iCol,
CATBSTR iName)

Sets the name of a table cell.

Parameters:

iRow
The cell row
iCol
The cell column
iName
The cell name

Example:
This example sets the name of the cell (1,2) of the table
MyTable to “Cell 2”.

iRow = 1
iCol = 2
iName = “Cell 2”
MyTable.SetCellName iRow, iCol, iName
Parameters:
  • i_row (int) –

  • i_col (int) –

  • i_name (str) –

Return type:

None

set_cell_object(i_row: int, i_col: int, i_text: DrawingText) None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub SetCellObject(long iRow,
long iCol,
DrawingText iText)

Sets an object in a cell of a drawing table.

Parameters:

iRow
The cell row
iCol
The cell column
iText
The Drawing Text to set in the cell

Example:
This example puts the drawing text iText in the cell (1,3) of
the table MyTable.

iRow = 1
iCol = 3
MyTable.SetCellObject iRow, iCol, iText
Parameters:
  • i_row (int) –

  • i_col (int) –

  • i_text (DrawingText) –

Return type:

None

set_cell_string(i_row: int, i_col: int, i_string: str) None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub SetCellString(long iRow,
long iCol,
CATBSTR iString)

Fills in a table cell with a string.

Parameters:

iRow
The cell row
iCol
The cell column
iString
The Text to be set

Example:
This example fills in the cell (3,2) of the table MyTable with
“Title”.

iRow = 3
iCol = 2
iString = “Title”
MyTable.SetCellString iRow, iCol, iString
Parameters:
  • i_row (int) –

  • i_col (int) –

  • i_string (str) –

Return type:

None

set_column_size(i_col: int, i_col_size: float) None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub SetColumnSize(long iCol,
double iColSize)

Sets the width of a column of a drawing table.

Parameters:

iCol
The cell column
iColSize
The cell width in mm. If 0, the width is automatic (corresponds to
the size of the widest cell of the column).

Example:
This example sets the width of the column (1) of the drawing
table MyTable to 20.

iCol = 1
iColSize = 20
MyTable.SetColumnSize iCol, iColSize
Parameters:
  • i_col (int) –

  • i_col_size (float) –

Return type:

None

set_row_size(i_row: int, i_row_size: float) None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub SetRowSize(long iRow,
double iRowSize)

Sets the height of a row of a drawing table.

Parameters:

iRow
The cell row
iRowSize
The cell height in mm. If 0, the height is automatic (corresponds
to the size of the highest cell of the row).

Example:
This example sets the height of the row (1) of the drawing
table MyTable to 20.

iRow = 1
iRowSize = 20
MyTable.SetRowSize iRow, iRowSize
Parameters:
  • i_row (int) –

  • i_row_size (float) –

Return type:

None

un_merge_cells(i_row: int, i_col: int) None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub UnMergeCells(long iRow,
long iCol)

Unmerges a group of cells.

Parameters:

iRow
@param iCol A cell of a merge

Example:
This example unmerges a group of cells of the drawing table
MyTable from the cell (3, 5).

MyTable.UnMergeCells 3, 5
Parameters:
  • i_row (int) –

  • i_col (int) –

Return type:

None

property x: float

Note

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

Returns or sets the x coordinate of the table. It is expressed with respect
to the current view coordinate system. This coordinate, like any length, is
measured in mm.

Example:
This example retrieves the x coordinate of the table MyTable drawing
table.

X = MyTable.x
Return type:

float

property y: float

Note

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

Returns or sets the y coordinate of the table. It is expressed with respect
to the view coordinate system. This coordinate, like any length, is measured in
mm.

Example:
This example sets the y coordinate of the table MyTable drawing table
to 5 inches. You need first to convert the 5 inches into
mm.

NewYCoordinate = 100
MyTable.y = NewYCoordinate
Return type:

float