All Frameworks  Object Hierarchy  This Framework  Indexes   

DrawingText (Object)

Represents a drawing text in a drawing view.

Property Index

AnchorPosition
Returns or sets the anchor position of the drawing text.
Angle
Returns or sets the angle of the drawing text.
AssociativeElement
Returns or sets the associative object of the drawing text.
FrameType
Returns or sets the frame type of the drawing text.
Leaders
Returns the drawing leader collection of the drawing text.
TextProperties
Returns the text properties of the drawing text.
Text
Returns or sets character string that makes up the text.
WrappingWidth
Returns or sets the wrapping width of the drawing text.
x
Returns or sets the x coordinate of the text.
y
Returns or sets the y coordinate of the text.

Method Index

ActivateFrame
Activates the text frame of the drawing text.
GetFontName
Returns the font name on a substring of the drawing text.
GetFontSize
Returns the font size on a substring of the drawing text.
GetModifiableIn2DComponentInstances
Returns if the text is modifiable or not in 2D component instances.
GetParameterOnSubString
Returns a property on a substring of the drawing text.
InsertVariable
Sets a Parameter in a string of the drawing text.
SetFontName
Sets the font size on a substring of the drawing text.
SetFontSize
Sets the font size on a substring of the drawing text.
SetModifiableIn2DComponentInstances
Sets the text as modifiable in 2D component instances.
SetParameterOnSubString
Sets a property on a substring of the drawing text.

Properties


o Property AnchorPosition() As
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
 
o Property Angle() As
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
 
o Property AssociativeElement() As
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
 
o Property FrameType() As
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
 
o Property Leaders() As (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
 
o Property TextProperties() As (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
 
o Property Text() As
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
 
o Property WrappingWidth() As
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.
 
o Property x() As
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
 
o Property y() As
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
 

Methods


o Sub ActivateFrame( 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)
 
o Func GetFontName( iFirst,
inbCharacter) As
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)
 
o Func GetFontSize( iFirst,
inbCharacter) As
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)
 
o Func GetModifiableIn2DComponentInstances() As
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
 
o Func GetParameterOnSubString( iParam,
iFirst,
inbCharacter) As
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)
 
o Sub InsertVariable( iFirst,
inbCharacter,
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
 
o Sub SetFontName( iFirst,
inbCharacter,
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"
 
o Sub SetFontSize( iFirst,
inbCharacter,
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
 
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 
 
o Sub SetParameterOnSubString( iParam,
iFirst,
inbCharacter,
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
 

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