How do I create an annotation using ACT?

Aria
Aria Member, Employee Posts: 64
First Anniversary Ansys Employee First Answer Name Dropper
edited October 2023 in Structures

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

Tagged:

Answers

  • Aria
    Aria Member, Employee Posts: 64
    First Anniversary Ansys Employee First Answer Name Dropper
    edited October 2023 Answer ✓

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

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