Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Add text in drawing aligned to the left

Status
Not open for further replies.

iscariot

Mechanical
Oct 15, 2009
154
DE
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()
[indent]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[/indent]
End Sub
 
Replies continue below

Recommended for you

Hi

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", 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

- Romania
- EU
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top