Generate probe Graphics Annotations with Ansys Mechanical Scripting
DavLip
Member Posts: 2
**
in Structures
Hello!
I can use the following Code Snippet script to create a single label at a specific X,Y,Z-location:
labels_manager = Graphics.LabelManager result = Tree.FirstActiveObject with Transaction(): _old = labels_manager.GetObjectLabels(result) Graphics.LabelManager.DeleteLabels(_old) probe_label = labels_manager.CreateProbeLabel(result) point = Ansys.Mechanical.Graphics.Point([-142.835450,176.906526,105.497730],'mm') probe_label.Scoping.XYZ = point #probe_label.Note = "NULL" probe_label.Color = Ansys.ACT.Common.Graphics.Color(red=255, green=255, blue=255, alpha=100)
I want to make this stronger by being able to loop through a set of points in an array and assign a label to each one. How can I edit the snippet to do this?
0
Answers
-
Hi ! This example should help: https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v241/en/act_script/act_script_examples_hot_spot.html
1 -
Thanks! The Scripting in Mechanical Guide was weirdly hard for me to find.
I also found this:
https://www.padtinc.com/2023/08/08/crash-course-ansys-mechanical-scripting/A really good guide which helped me create a working script.
1