How to add an image underneath an ACT custom (post) object in Mechanical?

Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 450
100 Answers 250 Likes 100 Comments First Anniversary
✭✭✭✭
edited June 2023 in Structures

How to add an image underneath an ACT custom (post) object in Mechanical?

enter image description here

Tagged:

Answers

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 450
    100 Answers 250 Likes 100 Comments First Anniversary
    ✭✭✭✭
    Answer ✓
    # Retrieve your post object - `post_object`
    post_internal_object = post_object.InternalObject
    image = post_internal_object.AddImage()
    image.SourceType = 1
    image.ImagePath = image_path  # Provide complete path to the image to be added.
    
    ExtAPI.DataModel.Tree.Refresh()