×
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

Add text in drawing aligned to the left

Add text in drawing aligned to the left

Add text in drawing aligned to the left

(OP)
How can I align in a drawing some text to the left?
I found some example code (as the one from below) but I can't align the text to the left (Justification left).

I tried something like this but it does not work:
Legende_texte.Justification = catLeft

What am I doing wrong?

CODE -->

Sub CATMain()
Set drawingDocument1 = CATIA.ActiveDocument Set drawingSheets1 = drawingDocument1.Sheets Set drawingSheet1 = drawingSheets1.Item("Sheet.1") Set ActiveView = drawingSheet1.Views.Item(1) Dim collection_textes As DrawingTexts Set collection_textes = ActiveView.Texts Dim Legende_texte As DrawingText Set Legende_texte = collection_textes.Add("TEST", 1, 1) Legende_texte.SetFontName 0, 0, "SSS1" Legende_texte.SetFontSize 0, 0, 4.24 Legende_texte.SetParameterOnSubString catItalic, 0, 0, 1
End Sub

RE: Add text in drawing aligned to the left

Hi

CODE --> CATScript

Sub CATMain()
Set drawingDocument1 = CATIA.ActiveDocument
Set drawingSheets1 = drawingDocument1.Sheets
Set drawingSheet1 = drawingSheets1.Item("Sheet.1")
Set ActiveView = drawingSheet1.Views.Item(1)
Dim collection_textes As DrawingTexts
Set collection_textes = ActiveView.Texts
Dim Legende_texte As DrawingText
Set Legende_texte = collection_textes.Add("TEST", 200, 200)
Legende_texte.SetFontName 0, 0, "SSS1"
Legende_texte.SetFontSize 0, 0, 4.24
Legende_texte.SetParameterOnSubString catItalic, 0, 0, 1

        For numtxt = 1 To collection_textes.Count        
             Set CurrentText = collection_textes.Item(numtxt)         
             CurrentText.SetParameterOnSubString catAlignment, 0, 0, catLeft      
        Next
        
End Sub 

Regards
Fernando

https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU

RE: Add text in drawing aligned to the left

(OP)
Thank you, it works.

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