pycatia.drafting_interfaces.drawing_text

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_text.DrawingText(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
DrawingText

Represents a drawing text in a drawing view.
activate_frame(itype: int) None

Note

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

Activates the text frame of the drawing text.

Example:
This example adds a rectangle frame to MyText drawing
text.

CatTextFrameType ityp = catRectangle
MyText.ActivateFrame(itype)


This example removes the frame to MyText drawing text.

CatTextFrameType ityp = catNone
MyText.ActivateFrame(itype)
Parameters:

itype (int) – enum cat_text_frame_type

Return type:

None

property anchor_position: int

Note

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

Returns or sets the anchor position of the drawing text.

Example:
This example sets the anchor position of the MyText drawing text to top
left position.

MyText.AnchorPosition = TopLeft
Returns:

enum cat_text_anchor_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 of the drawing text. The angle is measured
between the axis system of the drawing view and the local axis system of the
drawing text. The angle is measured in radians and is counted
counterclockwise.

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

Angle90Clockwise = -90
MyText.Angle = Angle90Clockwise
Return type:

float

property associative_element: AnyObject

Note

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

Returns or sets the associative object of the drawing
text.

Example:
This example sets an associative line of the MyText drawing text to top
left position.

MyText.AssociativeElement = line
Return type:

AnyObject

property frame_type: int

Note

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

Returns or sets the frame type of the drawing text.

Example:
This example sets the frame type of the MyText drawing text to an
ellipse.

MyText.FrameType = catEllipse
Returns:

enum cat_text_frame_type

Return type:

int

get_font_name(i_first, inb_character)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func GetFontName(long iFirst,
long inbCharacter) As CATBSTR

Returns the font name on a substring of the drawing text.

Parameters:

iFirst
The first character to which the property should apply

inbCharacter
The number of characters to which the property should apply


Returns:
oFontName The name of the font
Example:
This example gets the MyText drawing text font.

oFontName = MyText.GetFontName(0, 0)
Parameters:
  • i_first (int) –

  • inb_character (int) –

Return type:

str

get_font_size(i_first: int, inb_character: int) float

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func GetFontSize(long iFirst,
long inbCharacter) As double

Returns the font size on a substring of the drawing text.

Parameters:

iFirst
The first character to which the property should apply

inbCharacter
The number of characters to which the property should apply


Returns:
oFontSize The size of the font
Example:
This example gets the MyText font size.

oFontSize = MyText.GetFontSize(0, 0)
Parameters:
  • i_first (int) –

  • inb_character (int) –

Return type:

float

get_modifiable_in_2d_component_instances() bool

Note

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

Returns if the text is modifiable or not in 2D component instances. The
text must own to a 2D component (NOT to a view)

Example:
This example retrieves if MyText drawing text is modifiable or
not

IsModifiable = MyText.GetModifiableIn2DComponentInstances
Return type:

bool

get_parameter_on_sub_string(i_param: int, i_first: int, inb_character: int) int

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func GetParameterOnSubString(CatTextProperty iParam,
long iFirst,
long inbCharacter) As long

Returns a property on a substring of the drawing text.

Parameters:

iParam
The drawing text property
iFirst
The first character to which the property should apply

inbCharacter
The number of characters to which the property should apply


Returns:
oval The value corresponding to the property
Example:
This example gets the parameter Italic on MyText drawing
text.

CatTextProperty iParam = catItalic
iFirst = 0
inbCharacter = 0
oval = MyText.GetParameterOnsubString(iParam, iFirst, inbCharacter)
Parameters:
  • i_param (int) – enum cat_text_property

  • i_first (int) –

  • inb_character (int) –

Return type:

int

insert_variable(i_first: int, inb_character: int, ibase: AnyObject) None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub InsertVariable(long iFirst,
long inbCharacter,
CATBaseDispatch ibase)

Sets a Parameter in a string of the drawing text.

Parameters:

iFirst
The first character from which the parameter is inserted

inbCharacter
The number of characters the parameter will replace

iParameter
The parameter to be inserted
Example:
This example sets a parameter right at the end of MyText drawing
text.

Dim DrwDocument As DrawingDocument
Set DrwDocument = CATIA.ActiveDocument

Dim iParameter As Parameter
Set iParameter = DrwDocument.Parameters.Item(“Drawing/Sheet.1/ViewMakeUp.1/Scale”)

MyText.InsertVariable 0, 0, iParameter
Parameters:
  • i_first (int) –

  • inb_character (int) –

  • ibase (AnyObject) –

Return type:

None

property leaders

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 text.

Example:
This example retrieves in LeaderCollection the collection of leaders of
the MyText drawing text.

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

DrawingLeaders

set_font_name(i_first: int, inb_character: int, i_font_name: str) None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub SetFontName(long iFirst,
long inbCharacter,
CATBSTR iFontName)

Sets the font size on a substring of the drawing text.

Parameters:

iFirst
The first character to which the property should apply

inbCharacter
The number of characters to which the property should apply

iFontName
The name of the font

Example:
This example sets the MyText drawing text font as Courrier 10
BT.

MyText.SetFontName 0, 0, “Courrier 10 BT”
Parameters:
  • i_first (int) –

  • inb_character (int) –

  • i_font_name (str) –

Return type:

None

set_font_size(i_first: int, inb_character: int, i_font_size: float) None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub SetFontSize(long iFirst,
long inbCharacter,
double iFontSize)

Sets the font size on a substring of the drawing text.

Parameters:

iFirst
The first character to which the property should apply

inbCharacter
The number of characters to which the property should apply

iFontSize
The size of the font
Example:
This example sets the MyText font size to 3.5.

iFontSize = 3.5
MyText.SetFontSize 0, 0, iFontSize
Parameters:
  • i_first (int) –

  • inb_character (int) –

  • i_font_size (float) –

Return type:

None

set_modifiable_in_2d_component_instances() None

Note

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

Sets the text as modifiable in 2D component instances.The text must own to
a 2D component (NOT to a view).then ,its content will be modifiable inside
instances of this 2D component.

Example:
This example sets the MyText drawing text as
modifiable.

MyText.SetModifiableIn2DComponentInstances
Return type:

None

set_parameter_on_sub_string(i_param: int, i_first: int, inb_character: int, i_val: int) None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub SetParameterOnSubString(CatTextProperty iParam,
long iFirst,
long inbCharacter,
long iVal)

Sets a property on a substring of the drawing text.

Parameters:

iParam
The drawing text property
iFirst
The first character to which the property should apply

inbCharacter
The number of characters to which the property should apply

iVal
The value to be applied according to the property
Example:
This example sets all MyText drawing text in bold
character.

CatTextProperty iParam = catBold
iFirst = 0
inbCharacter = 0
ival = 1
MyText.SetParameterOnsubString iParam, iFirst, inbCharacter,
ival
Parameters:
  • i_param (int) – enum cat_text_property

  • i_first (int) –

  • inb_character (int) –

  • i_val (int) –

Return type:

None

property text: str

Note

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

Returns or sets character string that makes up the text.

Example:
This example retrieves in CharString the character string of the MyText
drawing text.

CharString = MyText.Text
Return type:

str

property text_properties: DrawingTextProperties

Note

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

Returns the text properties of the drawing text. Allows to modify the whole
text properties. To manage a sub part of the text use
GetParameterOnSubString

Example:
This example retrieves in TextProperties the text properties of the
MyText drawing text.

Dim TextProperties As DrawingTextProperties
Set TextProperties = MyText.TextProperties
Return type:

DrawingTextProperties

property wrapping_width: float

Note

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

Returns or sets the wrapping width of the drawing text.

Example:
This example sets the wrapping width of the MyText drawing text to
50.

MyText.WrappingWidth = 50.
Return type:

float

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 text. It is expressed with respect
to the current view coordinate system. This coordinate, like any length, is
measured in meters.

Example:
This example retrieves the x coordinate of the text MyText drawing
text.

X = MyText.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 text. It is expressed with respect
to the view coordinate system. This coordinate, like any length, is measured in
meters.

Example:
This example sets the y coordinate of the text MyText drawing text to 5
inches. You need first to convert the 5 inches into
meters.

NewYCoordinate = 5*25.4/1000
MyText.y = NewYCoordinate
Return type:

float