


{"id":296218,"date":"2023-08-03T00:00:46","date_gmt":"2023-08-03T00:00:46","guid":{"rendered":"\/forum\/forums\/topic\/extract-joint-probes-with-scripting-api\/"},"modified":"2023-08-03T00:00:46","modified_gmt":"2023-08-03T00:00:46","slug":"extract-joint-probes-with-scripting-api","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/extract-joint-probes-with-scripting-api\/","title":{"rendered":"Extract joint probes with scripting API"},"content":{"rendered":"<p>I have a model with some joints (bushings to ground). I have several analyses in this model, in each analysis I have some joint probes that are telling me the joint force.&nbsp; I want to print the joint forces to a text file using scripting.&nbsp; First I was trying to just print the joint forces to the shell.&nbsp; I found this example to base my code on: https:\/\/ansyshelp.ansys.com\/account\/secured?returnurl=\/Views\/Secured\/corp\/v221\/en\/act_script\/act_script_examples_evaluate_spring_reaction_forces.html&nbsp;<\/p>\n<p>EXAMPLE:&nbsp;<\/p>\n<pre class=\"programlisting\"># Get access to solver data\nanalysis = Model.Analyses[0]\nsolver_data = analysis.Solution.SolverData\n\n# Get access to result reader\nwith analysis.GetResultsData() as reader:\n    spring_results = reader.GetResult(\"SPRING\")\n    # Get a list of all springs\n    springs = Model.Connections.GetChildren(DataModelObjectCategory.Spring, False)\n\n    for spring in springs:\n        print(spring.Name)\n\n        spring_data = solver_data.GetObjectData(spring)\n        element_id = spring_data.ElementId\n\n        fForce = spring_results.GetElementValues(element_id)\n        print(fForce[0])<\/pre>\n<p>But it&#8217;s for springs.&nbsp; Trying to change it to work for bushing joints, I don&#8217;t know what to put here: reader.GetResult(&#8220;SPRING&#8221;)&nbsp; I tried &#8220;reader.GetResult(&#8220;JOINT&#8221;) but that does not compile.&nbsp; It does run if I keep it as &#8220;SPRING&#8221; but the results are nonsense.&nbsp; Please help! I could not find any documentation on the GetResult function.<\/p>\n<p>Here is my code so far:<\/p>\n<p># Get access to solver data<br \/>analysis = Model.Analyses[0]<br \/>solver_data = analysis.Solution.SolverData<br \/># Get access to result reader<br \/>with analysis.GetResultsData() as reader:<br \/>&nbsp; &nbsp; joint_results = reader.GetResult(&#8220;SPRING&#8221;)<br \/>&nbsp; &nbsp; # Get a list of all joints<br \/>&nbsp; &nbsp; joints = Model.Connections.GetChildren(DataModelObjectCategory.Joint, True)<br \/>&nbsp; &nbsp; for joint in joints:<br \/>&nbsp; &nbsp; &nbsp; &nbsp; print(joint.Name)<br \/>&nbsp; &nbsp; &nbsp; &nbsp; joint_data = solver_data.GetObjectData(joint)<br \/>&nbsp; &nbsp; &nbsp; &nbsp; element_id = joint_data.ElementId<br \/>&nbsp; &nbsp; &nbsp; &nbsp; print(element_id)<br \/>&nbsp; &nbsp; &nbsp; &nbsp; fForce = joint_results.GetElementValues(element_id)<br \/>&nbsp; &nbsp; &nbsp; &nbsp; print(fForce[0])<\/p>\n<p>I am using 2022 R1<\/p>\n","protected":false},"template":"","class_list":["post-296218","topic","type-topic","status-closed","hentry","topic-tag-mechanicalworkbench-1","topic-tag-ansys-mechanical","topic-tag-python-scripting","topic-tag-scripting"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"I have a model with some joints (bushings to ground). I have several analyses in this model, in each analysis I have some joint probes that are telling me the joint force. I want to print the joint forces to a text file using scripting. First I was trying to just print the joint forces\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/extract-joint-probes-with-scripting-api\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Ansys Learning Forum | Ansys Innovation Space\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Extract joint probes with scripting API | Ansys Learning Forum\" \/>\n\t\t<meta property=\"og:description\" content=\"I have a model with some joints (bushings to ground). I have several analyses in this model, in each analysis I have some joint probes that are telling me the joint force. I want to print the joint forces to a text file using scripting. First I was trying to just print the joint forces\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/extract-joint-probes-with-scripting-api\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2023-08-03T00:00:46+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2023-08-03T00:00:46+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Extract joint probes with scripting API | Ansys Learning Forum\" \/>\n\t\t<meta name=\"twitter:description\" content=\"I have a model with some joints (bushings to ground). I have several analyses in this model, in each analysis I have some joint probes that are telling me the joint force. I want to print the joint forces to a text file using scripting. First I was trying to just print the joint forces\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/extract-joint-probes-with-scripting-api\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/#listItem\",\"name\":\"Topics\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/#listItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic-tag\\\/ansys-mechanical\\\/#listItem\",\"name\":\"ansys-mechanical\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic-tag\\\/ansys-mechanical\\\/#listItem\",\"position\":3,\"name\":\"ansys-mechanical\",\"item\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic-tag\\\/ansys-mechanical\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/extract-joint-probes-with-scripting-api\\\/#listItem\",\"name\":\"Extract joint probes with scripting API\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/#listItem\",\"name\":\"Topics\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/extract-joint-probes-with-scripting-api\\\/#listItem\",\"position\":4,\"name\":\"Extract joint probes with scripting API\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic-tag\\\/ansys-mechanical\\\/#listItem\",\"name\":\"ansys-mechanical\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#organization\",\"name\":\"Ansys Learning Forum\",\"description\":\"Ansys Innovation Space\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/extract-joint-probes-with-scripting-api\\\/#webpage\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/extract-joint-probes-with-scripting-api\\\/\",\"name\":\"Extract joint probes with scripting API | Ansys Learning Forum\",\"description\":\"I have a model with some joints (bushings to ground). I have several analyses in this model, in each analysis I have some joint probes that are telling me the joint force. I want to print the joint forces to a text file using scripting. First I was trying to just print the joint forces\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/extract-joint-probes-with-scripting-api\\\/#breadcrumblist\"},\"datePublished\":\"2023-08-03T00:00:46+00:00\",\"dateModified\":\"2023-08-03T00:00:46+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#website\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/\",\"name\":\"Ansys Learning Forum\",\"description\":\"Ansys Innovation Space\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Extract joint probes with scripting API | Ansys Learning Forum","description":"I have a model with some joints (bushings to ground). I have several analyses in this model, in each analysis I have some joint probes that are telling me the joint force. I want to print the joint forces to a text file using scripting. First I was trying to just print the joint forces","canonical_url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/extract-joint-probes-with-scripting-api\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BreadcrumbList","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/extract-joint-probes-with-scripting-api\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum#listItem","position":1,"name":"Home","item":"https:\/\/innovationspace.ansys.com\/forum","nextItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/topics\/#listItem","name":"Topics"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/topics\/#listItem","position":2,"name":"Topics","item":"https:\/\/innovationspace.ansys.com\/forum\/topics\/","nextItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/ansys-mechanical\/#listItem","name":"ansys-mechanical"},"previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/ansys-mechanical\/#listItem","position":3,"name":"ansys-mechanical","item":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/ansys-mechanical\/","nextItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/extract-joint-probes-with-scripting-api\/#listItem","name":"Extract joint probes with scripting API"},"previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/topics\/#listItem","name":"Topics"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/extract-joint-probes-with-scripting-api\/#listItem","position":4,"name":"Extract joint probes with scripting API","previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/ansys-mechanical\/#listItem","name":"ansys-mechanical"}}]},{"@type":"Organization","@id":"https:\/\/innovationspace.ansys.com\/forum\/#organization","name":"Ansys Learning Forum","description":"Ansys Innovation Space","url":"https:\/\/innovationspace.ansys.com\/forum\/"},{"@type":"WebPage","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/extract-joint-probes-with-scripting-api\/#webpage","url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/extract-joint-probes-with-scripting-api\/","name":"Extract joint probes with scripting API | Ansys Learning Forum","description":"I have a model with some joints (bushings to ground). I have several analyses in this model, in each analysis I have some joint probes that are telling me the joint force. I want to print the joint forces to a text file using scripting. First I was trying to just print the joint forces","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/#website"},"breadcrumb":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/extract-joint-probes-with-scripting-api\/#breadcrumblist"},"datePublished":"2023-08-03T00:00:46+00:00","dateModified":"2023-08-03T00:00:46+00:00"},{"@type":"WebSite","@id":"https:\/\/innovationspace.ansys.com\/forum\/#website","url":"https:\/\/innovationspace.ansys.com\/forum\/","name":"Ansys Learning Forum","description":"Ansys Innovation Space","inLanguage":"en-US","publisher":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/#organization"}}]},"og:locale":"en_US","og:site_name":"Ansys Learning Forum | Ansys Innovation Space","og:type":"article","og:title":"Extract joint probes with scripting API | Ansys Learning Forum","og:description":"I have a model with some joints (bushings to ground). I have several analyses in this model, in each analysis I have some joint probes that are telling me the joint force. I want to print the joint forces to a text file using scripting. First I was trying to just print the joint forces","og:url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/extract-joint-probes-with-scripting-api\/","article:published_time":"2023-08-03T00:00:46+00:00","article:modified_time":"2023-08-03T00:00:46+00:00","twitter:card":"summary_large_image","twitter:title":"Extract joint probes with scripting API | Ansys Learning Forum","twitter:description":"I have a model with some joints (bushings to ground). I have several analyses in this model, in each analysis I have some joint probes that are telling me the joint force. I want to print the joint forces to a text file using scripting. First I was trying to just print the joint forces"},"aioseo_meta_data":{"post_id":"296218","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"content","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":true,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2024-10-28 17:55:47","updated":"2024-10-28 17:55:47","ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/innovationspace.ansys.com\/forum\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/innovationspace.ansys.com\/forum\/topics\/\" title=\"Topics\">Topics<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/ansys-mechanical\/\" title=\"ansys-mechanical\">ansys-mechanical<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tExtract joint probes with scripting API\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/innovationspace.ansys.com\/forum"},{"label":"Topics","link":"https:\/\/innovationspace.ansys.com\/forum\/topics\/"},{"label":"ansys-mechanical","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/ansys-mechanical\/"},{"label":"Extract joint probes with scripting API","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/extract-joint-probes-with-scripting-api\/"}],"acf":[],"custom_fields":[{"0":{"_bbp_subscription":["290684","170445"],"_bbp_author_ip":["23.206.193.146"]," _bbp_last_reply_id":["0"]," _bbp_likes_count":["0"],"_bbp_likes_count":["1"],"_btv_view_count":["2961"],"_bbp_topic_status":["unanswered"],"_bbp_status":["publish"],"_bbp_notification_enabled":["7476"],"_bbp_topic_id":["296218"],"_bbp_forum_id":["27791"],"_bbp_engagement":["170445","290684"],"_bbp_voice_count":["2"],"_bbp_reply_count":["1"],"_bbp_last_reply_id":["298054"],"_bbp_last_active_id":["298054"],"_bbp_last_active_time":["2023-08-03 18:27:19"]},"test":"cheyennehuagmail-com"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/296218","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\/296218\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=296218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}