×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How to use ActivateFrame in VBscript

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

RE: How to use ActivateFrame in VBscript

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

RE: How to use ActivateFrame in VBscript

(OP)
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="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

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources