


{"id":370441,"date":"2024-07-04T09:26:40","date_gmt":"2024-07-04T09:26:40","guid":{"rendered":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/how-to-add-annotations-or-probes-using-python-in-mechanical-2020-version\/"},"modified":"2024-07-04T09:26:40","modified_gmt":"2024-07-04T09:26:40","slug":"how-to-add-annotations-or-probes-using-python-in-mechanical-2020-version","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/how-to-add-annotations-or-probes-using-python-in-mechanical-2020-version\/","title":{"rendered":"How to add annotations or probes using python in Mechanical 2020 version?"},"content":{"rendered":"<div>It seems in newer versions of Mechanical we can use LabelManager class but in 2020 we have to use either functions in Graphics.InternalObject (like setnewanno3dtext, AddAnnoItemDS,&#8230;) or use javascript functions directly. Using those functions I can edit the Graphics Annotations table cells but the actual label won&#8217;t appear in the 3d view and the new table row also disappears after focus changes.<\/div>\n<div>&nbsp;<\/div>\n<div>So it seems I&#8217;m missing the mouse click part where the label position is decided but I have no idea how to do that. I can&#8217;t find the javascript function that gets executed on mouse click nor I can find any way to simulate the mouse click via script.&nbsp;<\/div>\n<div>&nbsp;<\/div>\n<div>I also noticed the label may appear in position (0,0,0) if I run correct functions immediately after restarting the Mechanical. My guess is that it works because the mouse position has been initialised with (0,0,0).<\/div>\n<div>&nbsp;<\/div>\n<div>Any ideas?<\/div>\n","protected":false},"template":"","class_list":["post-370441","topic","type-topic","status-closed","hentry"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_btv_view_count":["950"],"_bbp_topic_status":["unanswered"],"_bbp_subscription":["170445","432087"],"_bbp_topic_id":["370441"],"_bbp_forum_id":["27791"],"_bbp_engagement":["170445","432087"],"_bbp_voice_count":["2"],"_bbp_reply_count":["3"],"_bbp_last_reply_id":["394250"],"_bbp_last_active_id":["394250"],"_bbp_last_active_time":["2024-11-19 10:57:23"]},"test":"hallinenjessegmail-com"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/370441","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/370441\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=370441"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}