pycatia.drafting_interfaces.drawing_component

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_component.DrawingComponent(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
DrawingComponent

Represents a drawing component instance (ditto) in a drawing
view.
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 of the drawing component instance. The angle is
given in the axis system of the drawing view The angle is measured in radians
and is counted counterclockwise.

Example:
This example sets the angle of the MyComponent drawing component
instance to 90 degrees clockwise. You first need to compute the angle in
radians and set the minus sign to indicate the rotation is
clockwise.

PI = 3.1415926535
Angle90Clockwise = -PI/2
MyComponent.Angle = Angle90Clockwise
Return type:

float

property comp_ref: DrawingView

Note

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

Returns the component reference of this drawing component instance. this is
a CATIADrawingView

Example:
This example gets the drawing component reference of the MyComponent
drawing component instance.

Dim ComponentRef As DrawingView
Set ComponentRef = MyComponent.CompRef
Return type:

DrawingView

explode() None

Note

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

Explodes the drawing component instance (every sub elements of the drawing
component are created). Note: The drawing component is not removed by Explode
method

Example:
This example Explodes the MyComponent drawing component instance and
removes it.

MyComponent.Explode
Set MySelection = CATIA.ActiveDocument.Selection
MySelection.clear
MySelection.add MyComponent
MySelection.delete
Return type:

None

explode_and_select() None

Note

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

Explodes the drawing component instance (every sub elements of the drawing
component are created) and put created sub elements in selection
set.

Example:
This example Explodes the MyComponent drawing component
instance.

MyComponent.ExplodeAndSelect
Return type:

None

expose_comp_ref() None

Note

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

Exposes the component reference of this drawing component instance in a new
detail sheet.

Example:
This example exposes the component reference of the MyComponent drawing
component instance in a new detail sheet.

MyComponent.ExposeCompRef
Return type:

None

expose_comp_ref_in_sheet(i_sheet: DrawingSheet) None

Note

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

Exposes the component reference of this drawing component instance in a
specific detail sheet.

Parameters:

iSheet
The drawing sheet where the reference component has to be exposed.
This sheet has to be a detail sheet, if not the component reference will be
placed in a new detail sheet.

Example:
This example exposes the component reference of the MyComponent
drawing component instance in the MyDetailSheet drawing
sheet.

MyComponent.ExposeCompRefInSheet
MyDetailSheet
Parameters:

i_sheet (DrawingSheet) –

Return type:

None

flip() None

Note

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

Flips the drawing component instance around X axis To flip around Y axis
you have to flip the component around X and to add a rotation of 180
degrees.

Example:
This example Flips the MyComponent drawing component
instance.

MyComponent.Flip
Return type:

None

get_flip() bool

Note

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

Returns the flip state of a drawing component instance around X
axis.

Example:
This example Get the flip info of the MyComponent drawing component
instance.

IsFlipped = MyComponent.GetFlip
Return type:

bool

get_matrix(io_matrix: tuple) None

Note

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

Gets the matrix of the drawing component instance. This matrix enables you
to define the position (index 4 and 5 of the matrix) and the scale, the angle
and the flip (index 0,1,2 and 3) of the drawing component instance at the same
time.

Parameters:

ioMatrix[0]
The 1st coordinate of the first vector
ioMatrix[1]
The 2nd coordinate of the first vector
ioMatrix[2]
The 1st coordinate of the second vector
ioMatrix[3]
The 2nd coordinate of the second vector
ioMatrix[4]
The x value of the translation vector
ioMatrix[5]
The y value of the translation vector
Parameters:

io_matrix (tuple) –

Return type:

None

get_modifiable_object(i_index: cat_variant) AnyObject

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func GetModifiableObject(CATVariant iIndex) As AnyObject

Gets a modifiable object by index or name in this drawing component
instance.

Example:
This example Gets the first modifiable object in the MyComponent
drawing component instance.

Object = MyComponent.GetModifiableObject(1)
Parameters:

i_index (cat_variant) –

Return type:

AnyObject

get_modifiable_objects_count() int

Note

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

Gets the number of modifiable objects in this drawing component
instance.

Example:
This example Gets the number of modifiable objects in MyComponent
drawing component instance.

Count = MyComponent.GetModifiableObjectsCount
Return type:

int

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 component instance (Workaround for
VBA keyword).

Example:
This example sets the scale of the MyComponent drawing component
instance to 0.5.

MyComponent.Scale2 = 0.5
Return type:

float

set_matrix(i_matrix: tuple) None

Note

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

Sets the matrix of the drawing component instance. This matrix enables you
to define the position (index 4 and 5 of the matrix) and the scale, the angle
and the flip (index 0,1,2 and 3) of the drawing component instance at the same
time.

Parameters:

ioMatrix[0]
The 1st coordinate of the first vector
ioMatrix[1]
The 2nd coordinate of the first vector
ioMatrix[2]
The 1st coordinate of the second vector
ioMatrix[3]
The 2nd coordinate of the second vector
ioMatrix[4]
The x value of the translation vector
ioMatrix[5]
The y value of the translation vector
Parameters:

i_matrix (tuple) –

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 drawing component instance
position. It is expressed with respect to the view coordinate system. This
coordinate, like any length, is measured in millimeters.

Example:
This example sets the x coordinate of the position of the MyComponent
drawing component instance to 5 inches. You need first to convert the 5 inches
into millimeters.

NewXCoordinate = 5*25.4
MyComponent.x = NewXCoordinate
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 drawing component instance
position. It is expressed with respect to the view coordinate system. This
coordinate, like any length, is measured in millimeters.

Example:
This example sets the y coordinate of the position of the MyComponent
drawing component instance to 5 inches. You need first to convert the 5 inches
into millimeters.

NewYCoordinate = 5*25.4
MyComponent.y = NewYCoordinate
Return type:

float