


{"id":34951,"date":"2019-04-25T17:56:49","date_gmt":"2019-04-25T17:56:49","guid":{"rendered":"\/forum\/forums\/topic\/design-modeler-scripting-commands-how-to-delete-features-bodies\/"},"modified":"2019-04-25T17:56:49","modified_gmt":"2019-04-25T17:56:49","slug":"design-modeler-scripting-commands-how-to-delete-features-bodies","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/design-modeler-scripting-commands-how-to-delete-features-bodies\/","title":{"rendered":"Design Modeler Scripting Commands &#8211; How to Delete Features\/Bodies"},"content":{"rendered":"<p>I was wondering if there is a way to DELETE a feature in Design Modeler after I&#8217;ve created it via DM script commands Specifically, I have a script to create a BOOLEAN function combining two bodies using the command &#8220;var NewBoolean= ag.gui.CreateBoolean()&#8221; and the corresponding example code shown below.<\/p>\n<p><\/p>\n<p>var NewBoolean= ag.gui.CreateBoolean(); &nbsp;<\/p>\n<p><\/p>\n<p>NewBoolean.Name&nbsp;= &#8220;Combine Function&#8221;;<\/p>\n<p><\/p>\n<p>NewBoolean.Operation = 0;<\/p>\n<p><\/p>\n<p>ag.listview.ActivateItem(&#8220;Tool Bodies&#8221;) ;<\/p>\n<p><\/p>\n<p>agb.ClearSelections() ;<\/p>\n<p><\/p>\n<p>body1 = ag.fm.Body(1);<\/p>\n<p><\/p>\n<p>agb.AddSelect(agc.TypeBody, body1) ;<\/p>\n<p><\/p>\n<p>body2 = ag.fm.Body(2);<\/p>\n<p><\/p>\n<p>agb.AddSelect(agc.TypeBody, body2) ;<\/p>\n<p><\/p>\n<p>ag.listview.ItemValue = &#8220;Apply&#8221;; &nbsp;<\/p>\n<p><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/us.v-cdn.net\/6032193\/uploads\/attachments\/bf978b88-8abc-4b48-93c4-aa3a0123d111\/228e5d12-3125-4621-94fe-aa3a012f9068_deleting-boolean-feature---dm.jpg?width=690&amp;upscale=false\" alt=\"\"><\/p>\n<p><\/p>\n<p>However within my automated process I would like to be able to select and delete this (and other) defined functions so that I can create new ones.<\/p>\n<p><\/p>\n<p>I have done alot of reading through the forums which has lead me to the helpful file&nbsp;<em>agEventHandler.js&nbsp;<\/em>where I have found the commands&nbsp;<em>&#8220;agTreeDeleteSelectedFeature(0)&#8221;;&nbsp;<\/em>and &#8220;<em>agDelete<\/em><em>&#8220;;<\/em> but so far these only seem to give me syntax and object errors.<\/p>\n<p><\/p>\n<p>Is anyone familiar with DM commands or have experience with a problem like this?<\/p>\n","protected":false},"template":"","class_list":["post-34951","topic","type-topic","status-closed","hentry"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_old_topic_id":["7123"],"_bbp_old_topic_author_name_id":["Anonymous"],"_bbp_old_is_topic_anonymous_id":["false"],"_bbp_old_closed_status_id":["publish"],"_bbp_author_ip":[null],"_bbp_old_sticky_status_id":["normal"],"_bbp_likes_count":["0","0"],"_btv_view_count":["2021"],"_bbp_subscription":["240002"],"_bbp_topic_status":["unanswered"],"_bbp_status":["publish"],"_bbp_topic_id":["34951"],"_bbp_forum_id":["27789"],"_bbp_engagement":["164879"],"_bbp_voice_count":["1"],"_bbp_reply_count":["0"],"_bbp_last_reply_id":["0"],"_bbp_last_active_id":["34951"],"_bbp_last_active_time":["2019-04-25 17:56:49"]},"test":"michal28"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/34951","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\/34951\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=34951"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}