Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use ActivateFrame in VBscript

Status
Not open for further replies.

joltinjohn

Aerospace
May 7, 2003
20
0
0
US
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
 
Replies continue below

Recommended for you

Hello,
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
 
Thanks tpal,
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=&quot;VBScript&quot; type=&quot;text/VBScript&quot;>

Set CATIA = GetObject(, &quot;CATIA.Application&quot;)
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(&quot;1&quot;, 100, 125)
Text.Name = &quot;Number&quot;
dAngle = 50
Text.Angle = dAngle
Text.SetFontSize 0, 0, 5
Text.SetFontName 0, 0, &quot;Arial&quot;
Text.ActivateFrame catTriangle
</script>

I have added &quot;Text.ActivateFrame catTriangle&quot; 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
 
OK.... I got it!!!!
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
 
Status
Not open for further replies.
Back
Top