Create multi-line comment in Mechanical tree ?

Member, Employee, GitHub-issue-creator Posts: 353
50 Answers 100 Comments Second Anniversary 25 Likes
✭✭✭✭
edited July 2023 in Structures

Looking for a way to write comments on multiple lines in a single comment object in Mechanical. I have tried:

  1. commentObj = ExtAPI.DataModel.Project.Model.Geometry.AddComment()
  2. commentObj.Name = 'NewName'
  3. commentObj.Text = " comment1 \n comment2 \n comment3"
  4. print commentObj.Text

When executing the above script, the comments are printed on new lines in the console, but in the comment object they remain on a single line:


Is there a way to print on multiple lines using AddComment()?

Tagged:

Best Answer

  • Member, Employee, GitHub-issue-creator Posts: 353
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭
    edited July 2023 Answer ✓

    The comment object displays text in HTML format. You could create multi-line comment, e.g., by using html <br> element:

    1. commentObj = ExtAPI.DataModel.Project.Model.Geometry.AddComment()
    2. commentObj.Name = 'NewName'
    3. commentObj.Text = 'comment1 <br> comment2 <br> comment3'


Welcome!

It looks like you're new here. Sign in or register to get started.