How to use ActivateFrame in VBscript
How to use ActivateFrame in VBscript
(OP)
Does anyone know how to use the ActivateFram Method in Catia V5R9. The help file says:
o Sub ActivateFrame( CatTextFrameType iType)
Activates the text frame of the drawing text.
Parameters:
iType
The text frame type
Example:
This example add a rectangle frame to MyText drawing text.
CatTextFrameType itype = catRectangle
MyText.ActivateFrame itype
Example:
This example remove the frame to MyText drawing text.
CatTextFrameType itype = catNone
MyText.ActivateFrame itype
But I cannot get the sytax correct or something because the frame never activates
o Sub ActivateFrame( CatTextFrameType iType)
Activates the text frame of the drawing text.
Parameters:
iType
The text frame type
Example:
This example add a rectangle frame to MyText drawing text.
CatTextFrameType itype = catRectangle
MyText.ActivateFrame itype
Example:
This example remove the frame to MyText drawing text.
CatTextFrameType itype = catNone
MyText.ActivateFrame itype
But I cannot get the sytax correct or something because the frame never activates





RE: How to use ActivateFrame in VBscript
here is sample:
Set tText = ThisDrawingTexts.Add(sStamp, 545, 125)
tText.Name = "Stamp"
dAngle = 50#
tText.Angle = dAngle
tText.SetFontSize 0, 0, 5#
tText.SetFontName 0, 0, "Arial"
tText.ActivateFrame catOblong
regards TPale
RE: How to use ActivateFrame in VBscript
but that still will not draw a frame around my text. If I run the script below only the number "1" will appear. Here is the script I am using:
<script language="VBScript" type="text/VBScript">
Set CATIA = GetObject(, "CATIA.Application")
Set DrwDocument = CATIA.ActiveDocument
Set DrwSheets = DrwDocument.Sheets
Set Selection = DrwDocument.Selection
Set DrwSheet = DrwSheets.ActiveSheet
Set DrwView = DrwSheet.Views.ActiveView
Set DrwTexts = DrwView.Texts
Set Text = DrwTexts.Add("1", 100, 125)
Text.Name = "Number"
dAngle = 50
Text.Angle = dAngle
Text.SetFontSize 0, 0, 5
Text.SetFontName 0, 0, "Arial"
Text.ActivateFrame catTriangle
</script>
I have added "Text.ActivateFrame catTriangle" but no triangle will appear. I have tried it a million ways without any luck. Could some one please take a look at it and let me know what you think?
John
RE: How to use ActivateFrame in VBscript
If I use the number instead of the cat enumeration it works.
Instead of Text.ActivateFrame catTriangle
I use Text.ActivateFrame 6
and I get a triangle.
Thanks for the help.
John