


{"id":359419,"date":"2024-03-28T11:04:05","date_gmt":"2024-03-28T11:04:05","guid":{"rendered":"\/forum\/forums\/topic\/set-remote-displacement-with-scripting\/"},"modified":"2024-03-28T13:34:48","modified_gmt":"2024-03-28T13:34:48","slug":"set-remote-displacement-with-scripting","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/set-remote-displacement-with-scripting\/","title":{"rendered":"Set Remote Displacement with scripting"},"content":{"rendered":"<p>I&#8217;m trying to set the XComponent value of Remote Displacement with scripting. I think the problem is on the last line and has something to do with the fact that it is originally set as &#8216;Free&#8217;. Appreciate any help to fix my code!<\/p>\n<p>Code Below,<\/p>\n<div>model=ExtAPI.DataModel.Project.Model<\/div>\n<div>static_structural = model.Analyses[0]<\/div>\n<div>eigenvalue_buckling = model.Analyses[1]<\/div>\n<div>solution=eigenvalue_buckling.Solution<\/div>\n<div>&nbsp;<\/div>\n<div>x=1<\/div>\n<div>&nbsp;<\/div>\n<div>&nbsp;<\/div>\n<div>rd=static_structural.AddRemoteDisplacement()<\/div>\n<div>rd.Location=ExtAPI.DataModel.GetObjectsByName(&#8220;ylaosa&#8221;)[0]<\/div>\n<div>&nbsp;<\/div>\n<div>rd.XComponent.ToString<\/div>\n<div>&nbsp;<\/div>\n<div>rd.XComponent.Output.SetDiscreteValue(0, Quantity(x, &#8220;m&#8221;))<\/div>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" src=\"\/forum\/wp-content\/uploads\/sites\/2\/2024\/03\/28-03-2024-1711623679-Screenshot 2024-03-28 130054.png\" alt=\"\"><\/p>\n","protected":false},"template":"","class_list":["post-359419","topic","type-topic","status-closed","hentry","topic-tag-python-scripting","topic-tag-scripting","topic-tag-scripts-1"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_subscription":["342417","58821"],"_bbp_author_ip":["23.52.43.10"]," _bbp_last_reply_id":["0"]," _bbp_likes_count":["0"],"_btv_view_count":["1498"],"_bbp_topic_status":["unanswered"],"_bbp_status":["publish"],"_bbp_topic_id":["359419"],"_bbp_forum_id":["27791"],"_bbp_engagement":["58821","342417"],"_bbp_voice_count":["2"],"_bbp_reply_count":["2"],"_bbp_last_reply_id":["359435"],"_bbp_last_active_id":["359435"],"_bbp_last_active_time":["2024-03-28 12:54:43"]},"test":"santtu-siponentuni-fi"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/359419","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\/359419\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=359419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}