-
-
December 12, 2024 at 9:31 amrichard.polzerSubscriber
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 find a solution yet.
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.
However, I want to create three different parts first (let'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, ...).
Does anyone have a suggestion how I could achieve that possibly?
# Python Script, API Version = V232
# delete selection
#selection = Selection.Create(GetRootPart().GetAllBodies())
#result = Delete.Execute(selection)
ClearAll()
mode = InteractionMode.Solid
result = ViewHelper.SetViewMode(mode)
GetRootPart().ClearAllPartData()
# Define Sketch Plane
plane = Plane.PlaneXY
result = ViewHelper.SetSketchPlane(plane)
# Sketch Inner Circle 1
origin = Point2D.Create(MM(0), MM(0))
result = SketchCircle.Create(origin, MM(2))
# Sketch Inner Circle 1
origin = Point2D.Create(MM(0), MM(0))
result = SketchCircle.Create(origin, MM(4))
# Solidify Sketch
mode = InteractionMode.Solid
result = ViewHelper.SetViewMode(mode, Info1)
# Extrude 1 Face
selection = Face1
options = ExtrudeFaceOptions()
options.ExtrudeType = ExtrudeType.Add
result = ExtrudeFaces.Execute(selection, MM(95), options, Info3)
# Create/Edit Mesh
options = CreateMeshOptions()
options.SolidElementShape = ElementShapeType.Hexahedral
options.SurfaceElementShape = ElementShapeType.QuadDominant
options.BlockingType = BlockingDecompositionType.Standard
options.ElementSize = MM(1)
options.MidsideNodes = MidsideNodesType.Kept
bodySelection = Body1
sweepFaceSelection = Selection.Empty()
result = CreateMesh.Execute(bodySelection, sweepFaceSelection, options)
# Rename Project
GetRootPart().SetName('4695_detailed')
# Rename Part
GetRootPart().Bodies[0].SetName("Ring1")
GetRootPart() -
December 12, 2024 at 10:59 amRobForum Moderator
Others might have suggestions, but from the Ansys Staff team we can only point you at https://github.com/ansys You may want to focus effort onto Discovery over SpaceClaim given the former is the newer of the two tools.
-
December 12, 2024 at 9:37 pmrichard.polzerSubscriber
Hello Rob,
that's a pity. I am doing the the Discovery Scripting Introduction, but as up to now I have not found information that I am looking for.
-
December 13, 2024 at 9:36 amRobForum Moderator
I'll flag to the Discovery team as they may know of more content. Also, 25R1 is due "soon" so watch for that as there may be additional information coming with that - I don't know as yet as I don't know what's public information.
-
- You must be logged in to reply to this topic.
- Unable to attach geometry 2024 R2
- Getting Mesh Faces With Specified Normal Via SpaceClaim Scripting (V241)
- How to provide blade angles in bladegen.
- DXF file loaded incorrectly
- plugin error failed to import assembly from spaceclaim
- Overlapping contact face
- Thermoelectric Cooler Model
- Issue Seeing Explore
- Warning Plugin Error Geometry in Design Modeler
- SpaceClaim stops sharing topology
-
1341
-
591
-
584
-
525
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.