All Frameworks  Object Hierarchy  This Framework  Indexes   

DrawingComponent (Object)

Represents a drawing component instance (ditto) in a drawing view.

Property Index

Angle
Returns or sets the angle of the drawing component instance.
CompRef
Returns the component reference of this drawing component instance.
Scale2
Returns or sets the scale of the drawing component instance (Workaround for VBA keyword).
x
Returns or sets the x coordinate of the drawing component instance position.
y
Returns or sets the y coordinate of the drawing component instance position.

Method Index

ExplodeAndSelect
Explodes the drawing component instance (every sub elements of the drawing component are created) and put created sub elements in selection set.
Explode
Explodes the drawing component instance (every sub elements of the drawing component are created).
ExposeCompRefInSheet
Exposes the component reference of this drawing component instance in a specific detail sheet.
ExposeCompRef
Exposes the component reference of this drawing component instance in a new detail sheet.
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.
GetFlip
Returns the flip state of a drawing component instance around X axis.
GetMatrix
Gets the matrix of the drawing component instance.
GetModifiableObject
Gets a modifiable object by index or name in this drawing component instance.
GetModifiableObjectsCount
Gets the number of modifiable objects in this drawing component instance.
SetMatrix
Sets the matrix of the drawing component instance.

Properties


o Property Angle() As
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
 
o Property CompRef() As (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
 
o Property Scale2() As
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
 
o Property x() As
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
 
o Property y() As
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
 

Methods


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
 
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
 
o Sub ExposeCompRefInSheet( 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
 
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
 
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
 
o Func GetFlip() As
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
 
o Sub GetMatrix( 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
o Func GetModifiableObject( iIndex) As
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)
 
o Func GetModifiableObjectsCount() As
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
 
o Sub SetMatrix( 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

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