Properties
- 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
- 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
- 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
- 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
- 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
- Property NbLink() As (Read Only)
-
Returns the number of attributes link
- Example:
-
This example gets number of attributes link of MyText drawing text.
nbLink = MyText.NbLink
- Property OrientationReference() As
-
Returns or sets the orientation reference of the drawing text.
0 : Sheet orientation
1 : View/Label/2Dcomponent orientation- Example:
-
This example sets the orientation reference of MyText drawing text to sheet orientation
MyText.OrientationReference = 0
- 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
- 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
- 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.
- 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
- 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
- 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)
- 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 dd>
- inbCharacter
- The number of characters to which the property should apply dd>
- Returns:
- oFontName The name of the font
- Example:
-
This example gets the MyText drawing text font.
oFontName = MyText.GetFontName(0, 0)
- Parameters:
-
- iFirst
- The first character to which the property should apply dd>
- inbCharacter
- The number of characters to which the property should apply dd>
- Returns:
- oFontSize The size of the font
- Example:
-
This example gets the MyText font size.
oFontSize = MyText.GetFontSize(0, 0)
- Example:
-
This example retrieves if MyText drawing text is modifiable or not
IsModifiable = MyText.GetModifiableIn2DComponentInstances
- Parameters:
-
- iIndex
- The index of the pointed parameter link. 1 <= iIndex <= NbLink
- Example:
-
This example gets the first parameter link of MyText drawing text.
Dim MyParm As Parameter MyParm = MyText.GetParameterLink(1) If MyParm.Value<>"Front view" Then 'Do something End If
- Parameters:
-
- iParam
- The drawing text property dd>
- iFirst
- The first character to which the property should apply dd>
- inbCharacter
- The number of characters to which the property should apply dd>
- 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:
-
- iFirst
- The first character from which the parameter is inserted dd>
- inbCharacter
- The number of characters the parameter will replace dd>
- 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:
-
- iFirst
- The first character to which the property should apply dd>
- inbCharacter
- The number of characters to which the property should apply dd>
- 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:
-
- iFirst
- The first character to which the property should apply dd>
- inbCharacter
- The number of characters to which the property should apply dd>
- 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
- Example:
-
This example sets the MyText drawing text as modifiable.
MyText.SetModifiableIn2DComponentInstances
- Parameters:
-
- iParam
- The drawing text property dd>
- iFirst
- The first character to which the property should apply dd>
- inbCharacter
- The number of characters to which the property should apply dd>
- 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