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.IUnknownSystem.IDispatchSystem.CATBaseUnknownSystem.CATBaseDispatchSystem.AnyObjectDrawingTextRepresents 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 drawingtext.CatTextFrameType ityp = catRectangleMyText.ActivateFrame(itype)This example removes the frame to MyText drawing text.CatTextFrameType ityp = catNoneMyText.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 CatTextAnchorPositionReturns or sets the anchor position of the drawing text.Example:This example sets the anchor position of the MyText drawing text to topleft 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 doubleReturns or sets the angle of the drawing text. The angle is measuredbetween the axis system of the drawing view and the local axis system of thedrawing text. The angle is measured in radians and is countedcounterclockwise.Example:This example sets the angle of the MyText drawing Text to 90 degreesclockwise. You first need to compute the angle in degrees and set the minussign to indicate the rotation is clockwise.Angle90Clockwise = -90MyText.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 CATBaseDispatchReturns or sets the associative object of the drawingtext.Example:This example sets an associative line of the MyText drawing text to topleft position.MyText.AssociativeElement = line
- Return type:
- property frame_type: int¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property FrameType() As CatTextFrameTypeReturns or sets the frame type of the drawing text.Example:This example sets the frame type of the MyText drawing text to anellipse.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 CATBSTRReturns the font name on a substring of the drawing text.Parameters:iFirstThe first character to which the property should applyinbCharacterThe number of characters to which the property should applyReturns:oFontName The name of the fontExample: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 doubleReturns the font size on a substring of the drawing text.Parameters:iFirstThe first character to which the property should applyinbCharacterThe number of characters to which the property should applyReturns:oFontSize The size of the fontExample: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 booleanReturns if the text is modifiable or not in 2D component instances. Thetext must own to a 2D component (NOT to a view)Example:This example retrieves if MyText drawing text is modifiable ornotIsModifiable = 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 longReturns a property on a substring of the drawing text.Parameters:iParamThe drawing text propertyiFirstThe first character to which the property should applyinbCharacterThe number of characters to which the property should applyReturns:oval The value corresponding to the propertyExample:This example gets the parameter Italic on MyText drawingtext.CatTextProperty iParam = catItaliciFirst = 0inbCharacter = 0oval = 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:iFirstThe first character from which the parameter is insertedinbCharacterThe number of characters the parameter will replaceiParameterThe parameter to be insertedExample:This example sets a parameter right at the end of MyText drawingtext.Dim DrwDocument As DrawingDocumentSet DrwDocument = CATIA.ActiveDocumentDim iParameter As ParameterSet 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 ofthe MyText drawing text.Dim LeaderCollection As DrawingLeadersSet LeaderCollection = MyText.Leaders
- Return type:
- 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:iFirstThe first character to which the property should applyinbCharacterThe number of characters to which the property should applyiFontNameThe name of the fontExample:This example sets the MyText drawing text font as Courrier 10BT.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:iFirstThe first character to which the property should applyinbCharacterThe number of characters to which the property should applyiFontSizeThe size of the fontExample:This example sets the MyText font size to 3.5.iFontSize = 3.5MyText.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 toa 2D component (NOT to a view).then ,its content will be modifiable insideinstances of this 2D component.Example:This example sets the MyText drawing text asmodifiable.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:iParamThe drawing text propertyiFirstThe first character to which the property should applyinbCharacterThe number of characters to which the property should applyiValThe value to be applied according to the propertyExample:This example sets all MyText drawing text in boldcharacter.CatTextProperty iParam = catBoldiFirst = 0inbCharacter = 0ival = 1MyText.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 CATBSTRReturns or sets character string that makes up the text.Example:This example retrieves in CharString the character string of the MyTextdrawing 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 (ReadOnly)Returns the text properties of the drawing text. Allows to modify the wholetext properties. To manage a sub part of the text useGetParameterOnSubStringExample:This example retrieves in TextProperties the text properties of theMyText drawing text.Dim TextProperties As DrawingTextPropertiesSet TextProperties = MyText.TextProperties
- Return type:
- property wrapping_width: float¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property WrappingWidth() As doubleReturns or sets the wrapping width of the drawing text.Example:This example sets the wrapping width of the MyText drawing text to50.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 doubleReturns or sets the x coordinate of the text. It is expressed with respectto the current view coordinate system. This coordinate, like any length, ismeasured in meters.Example:This example retrieves the x coordinate of the text MyText drawingtext.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 doubleReturns or sets the y coordinate of the text. It is expressed with respectto the view coordinate system. This coordinate, like any length, is measured inmeters.Example:This example sets the y coordinate of the text MyText drawing text to 5inches. You need first to convert the 5 inches intometers.NewYCoordinate = 5*25.4/1000MyText.y = NewYCoordinate
- Return type:
float