


{"id":298542,"date":"2023-08-07T14:47:52","date_gmt":"2023-08-07T14:47:52","guid":{"rendered":"\/forum\/forums\/topic\/geometry-tree-body-thickness-automation\/"},"modified":"2023-08-08T05:21:26","modified_gmt":"2023-08-08T05:21:26","slug":"geometry-tree-body-thickness-automation","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/geometry-tree-body-thickness-automation\/","title":{"rendered":"Geometry Tree Body Thickness automation"},"content":{"rendered":"<p>Hi, I&#8217;m doing a script that applies an arbitrary thickness to the parts of the geometry tree, depending on whether they are stored in a previously made dictionary or not.<br \/>However, when I try to set the thickness manually, I&#8217;m getting the error:<\/p>\n<p>&#8220;expected Quantity, got float&#8221;<\/p>\n<p>If someone could help me understand the error or the way to convert a floating number into the so-called &#8220;Quantity&#8221;, I&#8217;d be very grateful to you.<\/p>\n<p>My code goes:<\/p>\n<p>&nbsp;for key, values in partAndBody.items():<br \/>&nbsp; &nbsp; for part in geom.Children:<br \/>&nbsp; &nbsp; &nbsp; &nbsp; for body in part.Children:&nbsp;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if values[2] == &#8216;Plane Stress&#8217;:<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; body.Behavior = Model2DBehavior.PlaneStress<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; body.Thickness = values[3]<\/p>\n<p>thank you in advance.<\/p>\n","protected":false},"template":"","class_list":["post-298542","topic","type-topic","status-closed","hentry"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_subscription":["275191","58821"],"_bbp_author_ip":["23.206.193.150"]," _bbp_last_reply_id":["0"]," _bbp_likes_count":["0"],"_btv_view_count":["325"],"_bbp_status":["publish"],"_bbp_topic_status":["unanswered"],"_bbp_topic_id":["298542"],"_bbp_forum_id":["27791"],"_bbp_engagement":["58821","275191"],"_bbp_voice_count":["2"],"_bbp_reply_count":["2"],"_bbp_last_reply_id":["298645"],"_bbp_last_active_id":["298645"],"_bbp_last_active_time":["2023-08-08 05:21:17"]},"test":"ander-alvarezsafrangroup-com"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/298542","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\/298542\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=298542"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}