How do I create an annotation using ACT?

Member, Employee Posts: 67
25 Answers Second Anniversary 25 Likes 10 Comments
✭✭✭✭
edited October 2023 in Structures

I want to create an annotation at a certain coordinate, displaying some text. How do I proceed?

Tagged:

Best Answer

  • Member, Employee Posts: 67
    25 Answers Second Anniversary 25 Likes 10 Comments
    ✭✭✭✭
    edited October 2023 Answer ✓

    We can create an annotation without user interaction through Graphics.Scene:

    1. annotStr = r"This is my String"
    2. """
    3. The coordinates below should be in the geometry units
    4. (DataModel.GeoData.Unit)
    5. """
    6. coor = [0,0,0]
    7.  
    8. Point3D = ExtAPI.Graphics.CreateWorldPoint
    9. Pt = Point3D(coor[0], coor[1], coor[2])
    10. Label = ExtAPI.Graphics.Scene.Factory2D.CreateText(Pt, str(annotStr))
    11. """Hex color = black is used below (0x000000)"""
    12. Label.Color = 0x000000
    13. Label.Highlight(100,100)

Answers

  • Member Posts: 6
    First Anniversary Name Dropper First Comment
    **

    Hi,

    Is there a way to adjust the text size and line width? The line width property is available, but does not seem to cause any change.

Welcome!

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