Easy way to “reverse” midsurface and convert surface with thickness to solid.
TAGGED: ansys-spaceclaim
-
-
August 29, 2025 at 3:16 pm
mscal
SubscriberSuppose I have a planar surface body with a thickness assigned to it. Is there an easy way to convert it to a solid with the same thickness? I know I can do a double-sided pull, but that must be done manually as I understand it. My surface body is the result of a midsurface opertation on a thin solid body, but the solid which is suppressed from the Midsurface operation has been deleted and cannot be retrieved. Thank you.
-
August 30, 2025 at 2:59 pm
peteroznewman
SubscriberYou know you can manually do a double-sided Pull to get the solid back. What is the problem with doing that?
-
September 2, 2025 at 12:59 pm
mscal
SubscriberI have several hundred such surfaces in my model. Surely you can understand why pulling each and every one of them is undesireable. And since midsurface can batch transform solids to surfaces, it stands to reason that there might be a tool for doing the opposite when a surface has a shell thickness assinged. Right?
-
-
September 1, 2025 at 11:12 am
NickFL
SubscriberYes, as you say, you can do a double-sided pull. If you had lots of these and were trying to find and pull them all, you could write a Python script to automate the process. You could even extend the script so that it could be activated with a mouse click. However, without knowing your model, it is difficult to say what is best. A sample script is something like:
# Python Script, API Version = V23
thickness = 1.0 # in mm
bodies = GetRootPart().GetAllBodies() # Gets all the bodies
for body in bodies:
if body.Shape.Volume == 0.0: # if volume is 0 then surface body
selection = FaceSelection.Create(body.Faces[0])
options = ThickenFaceOptions()
options.PullSymmetric = True
result = ThickenFaces.Execute(selection, Direction.DirZ, MM(thickness), options)-
September 2, 2025 at 1:43 pm
mscal
SubscriberWow, thank you! After I posted my question last week, I messed around for a few hours trying to figure out a way to implement via scripting, but was not able to make much headway. However your example above gave me enough to bring it the rest of the way home.
# First loop to delete interior edges/partitions, remnant from shared top, so every body is one face
bodies = GetRootPart().GetAllBodies()
for body in bodies:
if body.Shape.Volume == 0.0:
if len(body.Faces) > 1:
for edge in body.Edges:
try:
edge.Delete()
except:
pass
# Loop again to execute the pull
bodies = GetRootPart().GetAllBodies()
for body in bodies:
if body.Shape.Volume == 0.0:
for face in body.Faces:
midsurf = body.GetMidSurfaceAspect()
# Must divide by 2 bc scripting doesn't account for the double sided pull
# How is GetThickness() different from TryGetFaceThickness() ??
thick = (midsurf.GetThickness()) / 2
selection = FaceSelection.Create(face)
options = ThickenFaceOptions()
options.PullSymmetric = True
options.KeepLayoutSurfaces = True
options.ExtrudeType = ExtrudeType.ForceIndependent # No merge
result = ThickenFaces.Execute(selection, Direction.DirZ, M(thick), options)
-
-
- You must be logged in to reply to this topic.
-
5849
-
1906
-
1420
-
1305
-
1021
© 2026 Copyright ANSYS, Inc. All rights reserved.