


{"id":397218,"date":"2024-12-12T09:31:09","date_gmt":"2024-12-12T09:31:09","guid":{"rendered":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/spaceclaim-script-from-scratch-for-fully-meshed-model\/"},"modified":"2024-12-12T09:31:09","modified_gmt":"2024-12-12T09:31:09","slug":"spaceclaim-script-from-scratch-for-fully-meshed-model","status":"publish","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/spaceclaim-script-from-scratch-for-fully-meshed-model\/","title":{"rendered":"SpaceClaim Script: from scratch for fully meshed model"},"content":{"rendered":"<p>&lt;p&gt;Dear Ansys Learning Forum Community,&lt;\/p&gt;&lt;p&gt;I am rather new to ANSYS, but delighted about the power of recording and running python script to generate geometry and create a mesh. I am more familiar with ANSA but I will swap my toolset for SPACECLAIM. However, I am still running in a few issues where i could not find a solution yet.&lt;\/p&gt;&lt;p&gt;My aim is to create a model of concentric solid tubes. So far I only achieved to create one tube and mesh it, see below.&lt;\/p&gt;&lt;p&gt;However, I want to create three different parts first (let&#8217;s call it part1 part2 part3) and with some logic create a tube, assign it to one of the parts, create the next concentric tube, assign it to another part and so forth. The parts are repeating (e.g. part1, part2, part3, part1, part2, part3, &#8230;).&lt;\/p&gt;&lt;p&gt;Does anyone have a suggestion how I could achieve that possibly?&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;<\/p>\n<pre># Python Script, API Version = V232&lt;br&gt;&lt;br&gt;# delete selection&lt;br&gt;#selection = Selection.Create(GetRootPart().GetAllBodies())&lt;br&gt;#result = Delete.Execute(selection)&lt;br&gt;&lt;br&gt;ClearAll()&lt;br&gt;&lt;br&gt;mode = InteractionMode.Solid&lt;br&gt;result = ViewHelper.SetViewMode(mode)&lt;br&gt;GetRootPart().ClearAllPartData()&lt;br&gt;&lt;br&gt;# Define Sketch Plane&lt;br&gt;plane = Plane.PlaneXY&lt;br&gt;result = ViewHelper.SetSketchPlane(plane)&lt;br&gt;&lt;br&gt;# Sketch Inner Circle 1&nbsp;&lt;br&gt;origin = Point2D.Create(MM(0), MM(0))&lt;br&gt;result = SketchCircle.Create(origin, MM(2))&lt;br&gt;&lt;br&gt;# Sketch Inner Circle 1&lt;br&gt;origin = Point2D.Create(MM(0), MM(0))&lt;br&gt;result = SketchCircle.Create(origin, MM(4))&lt;br&gt;&lt;br&gt;# Solidify Sketch&lt;br&gt;mode = InteractionMode.Solid&lt;br&gt;result = ViewHelper.SetViewMode(mode, Info1)&lt;br&gt;&lt;br&gt;# Extrude 1 Face&lt;br&gt;selection = Face1&lt;br&gt;options = ExtrudeFaceOptions()&lt;br&gt;options.ExtrudeType = ExtrudeType.Add&lt;br&gt;result = ExtrudeFaces.Execute(selection, MM(95), options, Info3)&lt;br&gt;&lt;br&gt;# Create\/Edit Mesh&lt;br&gt;options = CreateMeshOptions()&lt;br&gt;options.SolidElementShape = ElementShapeType.Hexahedral&lt;br&gt;options.SurfaceElementShape = ElementShapeType.QuadDominant&lt;br&gt;options.BlockingType = BlockingDecompositionType.Standard&lt;br&gt;options.ElementSize = MM(1)&lt;br&gt;options.MidsideNodes = MidsideNodesType.Kept&lt;br&gt;bodySelection = Body1&lt;br&gt;sweepFaceSelection = Selection.Empty()&lt;br&gt;result = CreateMesh.Execute(bodySelection, sweepFaceSelection, options)&lt;br&gt;&lt;br&gt;&lt;br&gt;# Rename Project&lt;br&gt;GetRootPart().SetName('4695_detailed')&lt;br&gt;&lt;br&gt;# Rename Part&lt;br&gt;GetRootPart().Bodies[0].SetName(\"Ring1\")&lt;br&gt;GetRootPart()&lt;br&gt;&lt;br&gt;&lt;br&gt;<\/pre>\n","protected":false},"template":"","class_list":["post-397218","topic","type-topic","status-publish","hentry"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"Dear Ansys Learning Forum Community,I am rather new to ANSYS, but delighted about the power of recording and running python script to generate geometry and create a mesh. I am more familiar with ANSA but I will swap my toolset for SPACECLAIM. However, I am still running in a few issues where i could not\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/spaceclaim-script-from-scratch-for-fully-meshed-model\/\" \/>\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=\"SpaceClaim Script: from scratch for fully meshed model | Ansys Learning Forum\" \/>\n\t\t<meta property=\"og:description\" content=\"Dear Ansys Learning Forum Community,I am rather new to ANSYS, but delighted about the power of recording and running python script to generate geometry and create a mesh. I am more familiar with ANSA but I will swap my toolset for SPACECLAIM. However, I am still running in a few issues where i could not\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/spaceclaim-script-from-scratch-for-fully-meshed-model\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2024-12-12T09:31:09+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2024-12-12T09:31:09+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"SpaceClaim Script: from scratch for fully meshed model | Ansys Learning Forum\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Dear Ansys Learning Forum Community,I am rather new to ANSYS, but delighted about the power of recording and running python script to generate geometry and create a mesh. I am more familiar with ANSA but I will swap my toolset for SPACECLAIM. However, I am still running in a few issues where i could not\" \/>\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\\\/spaceclaim-script-from-scratch-for-fully-meshed-model\\\/#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\\\/spaceclaim-script-from-scratch-for-fully-meshed-model\\\/#listItem\",\"name\":\"SpaceClaim Script: from scratch for fully meshed model\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/spaceclaim-script-from-scratch-for-fully-meshed-model\\\/#listItem\",\"position\":3,\"name\":\"SpaceClaim Script: from scratch for fully meshed model\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/#listItem\",\"name\":\"Topics\"}}]},{\"@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\\\/spaceclaim-script-from-scratch-for-fully-meshed-model\\\/#webpage\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/spaceclaim-script-from-scratch-for-fully-meshed-model\\\/\",\"name\":\"SpaceClaim Script: from scratch for fully meshed model | Ansys Learning Forum\",\"description\":\"Dear Ansys Learning Forum Community,I am rather new to ANSYS, but delighted about the power of recording and running python script to generate geometry and create a mesh. I am more familiar with ANSA but I will swap my toolset for SPACECLAIM. However, I am still running in a few issues where i could not\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/spaceclaim-script-from-scratch-for-fully-meshed-model\\\/#breadcrumblist\"},\"datePublished\":\"2024-12-12T09:31:09+00:00\",\"dateModified\":\"2024-12-12T09:31:09+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":"SpaceClaim Script: from scratch for fully meshed model | Ansys Learning Forum","description":"Dear Ansys Learning Forum Community,I am rather new to ANSYS, but delighted about the power of recording and running python script to generate geometry and create a mesh. I am more familiar with ANSA but I will swap my toolset for SPACECLAIM. However, I am still running in a few issues where i could not","canonical_url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/spaceclaim-script-from-scratch-for-fully-meshed-model\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BreadcrumbList","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/spaceclaim-script-from-scratch-for-fully-meshed-model\/#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\/spaceclaim-script-from-scratch-for-fully-meshed-model\/#listItem","name":"SpaceClaim Script: from scratch for fully meshed model"},"previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/spaceclaim-script-from-scratch-for-fully-meshed-model\/#listItem","position":3,"name":"SpaceClaim Script: from scratch for fully meshed model","previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/topics\/#listItem","name":"Topics"}}]},{"@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\/spaceclaim-script-from-scratch-for-fully-meshed-model\/#webpage","url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/spaceclaim-script-from-scratch-for-fully-meshed-model\/","name":"SpaceClaim Script: from scratch for fully meshed model | Ansys Learning Forum","description":"Dear Ansys Learning Forum Community,I am rather new to ANSYS, but delighted about the power of recording and running python script to generate geometry and create a mesh. I am more familiar with ANSA but I will swap my toolset for SPACECLAIM. However, I am still running in a few issues where i could not","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/#website"},"breadcrumb":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/spaceclaim-script-from-scratch-for-fully-meshed-model\/#breadcrumblist"},"datePublished":"2024-12-12T09:31:09+00:00","dateModified":"2024-12-12T09:31:09+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":"SpaceClaim Script: from scratch for fully meshed model | Ansys Learning Forum","og:description":"Dear Ansys Learning Forum Community,I am rather new to ANSYS, but delighted about the power of recording and running python script to generate geometry and create a mesh. I am more familiar with ANSA but I will swap my toolset for SPACECLAIM. However, I am still running in a few issues where i could not","og:url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/spaceclaim-script-from-scratch-for-fully-meshed-model\/","article:published_time":"2024-12-12T09:31:09+00:00","article:modified_time":"2024-12-12T09:31:09+00:00","twitter:card":"summary_large_image","twitter:title":"SpaceClaim Script: from scratch for fully meshed model | Ansys Learning Forum","twitter:description":"Dear Ansys Learning Forum Community,I am rather new to ANSYS, but delighted about the power of recording and running python script to generate geometry and create a mesh. I am more familiar with ANSA but I will swap my toolset for SPACECLAIM. However, I am still running in a few issues where i could not"},"aioseo_meta_data":{"post_id":"397218","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":"default","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":false,"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":"2025-10-19 10:16:21","updated":"2026-09-17 13:29:46","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\tSpaceClaim Script: from scratch for fully meshed model\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":"SpaceClaim Script: from scratch for fully meshed model","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/spaceclaim-script-from-scratch-for-fully-meshed-model\/"}],"acf":[],"custom_fields":[{"0":{"_bbp_forum_id":["27789"],"_bbp_topic_id":["397218"],"_bbp_author_ip":["194.94.240.88"],"_bbp_last_reply_id":["397378"],"_bbp_last_active_id":["397378"],"_bbp_last_active_time":["2024-12-13 09:36:24"],"_bbp_reply_count":["3"],"_bbp_reply_count_hidden":["0"],"_bbp_voice_count":["2"],"_bbp_engagement":["475219","199"],"_btv_view_count":["2032"],"_bbp_topic_status":["unanswered"],"_bbp_notification_enabled":["475219"],"_bbp_subscription":["199","475219"]},"test":"richard-polzerthi-de"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/397218","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\/397218\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=397218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}