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?
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, 1End Sub





RE: Add text in drawing aligned to the left
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 SubRegards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Add text in drawing aligned to the left