


{"id":456993,"date":"2026-04-23T16:15:42","date_gmt":"2026-04-23T16:15:42","guid":{"rendered":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/how-do-i-create-bonded-contacts-using-script-editor\/"},"modified":"2026-04-23T16:15:42","modified_gmt":"2026-04-23T16:15:42","slug":"how-do-i-create-bonded-contacts-using-script-editor","status":"publish","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/how-do-i-create-bonded-contacts-using-script-editor\/","title":{"rendered":"How do I create Bonded Contacts using Script Editor"},"content":{"rendered":"<p>&lt;p&gt;<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/innovationspace.ansys.com\/forum\/wp-content\/uploads\/sites\/2\/2026\/04\/23-04-2026-1776960459-mceclip3.png\" width=\"401\" height=\"266\" \/>&lt;\/p&gt;&lt;p&gt;I want to create a bonded contact between the pink part and the teal part, but when i try doing it with the script, the result is not what i am look for. I&#8217;ve tried two methods, 1) creating a bond between the pink body and the teal body. 2) creating a bond between all faces of the pink body and all faces of the teal body (with .ConvertToFaces())&lt;\/p&gt;&lt;p&gt;It looks like the way that Ansys does it for you when you create the bonded contact manually is that it automatically selects the shared faces between the two bodies and creates a bonded contact.&nbsp;&lt;\/p&gt;&lt;p&gt;I&#8217;m thinking i need to find a way to filter out the faces that are in touching each other\/same size\/ same area\/ etc. and create a bonded contact that way, but I&#8217;m not sure if that&#8217;s the easiest way and I also don&#8217;t even know how to filter those specific faces out.&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;Bonded contact when done manually:&lt;\/p&gt;<\/p>\n<ul>\n<li>this is how i need it to look<\/li>\n<\/ul>\n<p>&lt;p&gt;<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/innovationspace.ansys.com\/forum\/wp-content\/uploads\/sites\/2\/2026\/04\/23-04-2026-1776960525-mceclip5.png\" width=\"454\" height=\"218\" \/>&lt;\/p&gt;&lt;p&gt;Bonded contact with script by selecting bodies:&nbsp;&lt;\/p&gt;&lt;p&gt;<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/innovationspace.ansys.com\/forum\/wp-content\/uploads\/sites\/2\/2026\/04\/23-04-2026-1776960494-mceclip4.png\" width=\"359\" height=\"223\" \/>&lt;\/p&gt;&lt;p&gt;&lt;span style=&#8221;font-size: 10pt; color: #236fa1;&#8221;&gt;contactGroup = Connections.ContactGroup.GetByLabel(&#8220;Bonded Contacts (default)&#8221;)&lt;\/span&gt;&lt;br&gt;&lt;span style=&#8221;font-size: 10pt; color: #236fa1;&#8221;&gt;contactType = ContactGroupConversionType.Bond&lt;\/span&gt;&lt;br&gt;&lt;span style=&#8221;font-size: 10pt; color: #236fa1;&#8221;&gt;contactPairs = List[Connections.ContactPair]()&lt;\/span&gt;&lt;br&gt;&lt;span style=&#8221;font-size: 10pt; color: #236fa1;&#8221;&gt;contactPair = Connections.ContactPair.Create(PinkBody, TealBody)&lt;\/span&gt;&lt;br&gt;&lt;span style=&#8221;font-size: 10pt; color: #236fa1;&#8221;&gt;contactPairs.Add(contactPair)&lt;\/span&gt;&lt;br&gt;&lt;span style=&#8221;font-size: 10pt; color: #236fa1;&#8221;&gt;contactGroup.ChangeType(contactType, contactPairs, 0, False)&lt;\/span&gt;&lt;\/p&gt;&lt;p&gt;&lt;span style=&#8221;color: #000000;&#8221;&gt;Bonded contact with script by selecting faces&lt;\/span&gt;&lt;\/p&gt;&lt;p&gt;&lt;span style=&#8221;color: #34495e;&#8221;&gt;<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/innovationspace.ansys.com\/forum\/wp-content\/uploads\/sites\/2\/2026\/04\/23-04-2026-1776960563-mceclip6.png\" width=\"483\" height=\"232\" \/>&lt;\/span&gt;&lt;\/p&gt;&lt;p&gt;&lt;span style=&#8221;color: #34495e;&#8221;&gt;&lt;span style=&#8221;font-size: 10pt; color: #236fa1;&#8221;&gt;contactGroup = Connections.ContactGroup.GetByLabel(&#8220;Bonded Contacts (default)&#8221;)&lt;\/span&gt;&lt;br&gt;&lt;span style=&#8221;font-size: 10pt; color: #236fa1;&#8221;&gt;contactType = ContactGroupConversionType.Bond&lt;\/span&gt;&lt;br&gt;&lt;span style=&#8221;font-size: 10pt; color: #236fa1;&#8221;&gt;contactPairs = List[Connections.ContactPair]()&lt;\/span&gt;&lt;br&gt;&lt;span style=&#8221;font-size: 10pt; color: #236fa1;&#8221;&gt;contactPair = Connections.ContactPair.Create(PinkBody.ConvertToFaces(), TealBody.ConvertToFaces())&lt;\/span&gt;&lt;br&gt;&lt;span style=&#8221;font-size: 10pt; color: #236fa1;&#8221;&gt;contactPairs.Add(contactPair)&lt;\/span&gt;&lt;br&gt;&lt;span style=&#8221;font-size: 10pt; color: #236fa1;&#8221;&gt;contactGroup.ChangeType(contactType, contactPairs, 0, False)&lt;\/span&gt;&lt;\/span&gt;&lt;\/p&gt;<\/p>\n","protected":false},"template":"","class_list":["post-456993","topic","type-topic","status-publish","hentry"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_forum_id":["27789"],"_bbp_topic_id":["456993"],"_bbp_subscription":["597105"],"_bbp_author_ip":["12.182.35.188"],"_bbp_last_reply_id":["0"],"_bbp_last_active_id":["456993"],"_bbp_last_active_time":["2026-04-23 16:15:42"],"_bbp_reply_count":["0"],"_bbp_reply_count_hidden":["0"],"_bbp_voice_count":["1"],"_bbp_engagement":["597105"],"_btv_view_count":["80"],"_bbp_topic_status":["unanswered"],"_edit_lock":["1776961009:597105"]},"test":"angmytogmail-com"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/456993","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\/456993\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=456993"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}