We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.

Ansys Learning Forum Forums Discuss Simulation 3D Design SpaceClaim Python API: Getting the results of a Check Geometry Reply To: SpaceClaim Python API: Getting the results of a Check Geometry

mjmiddle
Ansys Employee

The result of an operation returns a booean True or False when directly queried which is indicating whether the action succeded without error, but this is an object that is not boolean and will have many properties/methods below it when queried with dir(). In this case, the important object beneath result is "Messages." It will show it is type Dictionary[IDesignBody, IList[CheckMessage]].

So get messages for the first body this way:

all_bodies = GetRootPart().GetAllBodies()
selection = BodySelection.Create(all_bodies)
result = ApplicationHelper.CheckGeometry(selection)
Body1Messages = result.Messages[GetRootPart().Bodies[0]]
if Body1Messages.Count == 0:
    pass
    #no errors
else:
    for mess in Body1Messages:
        print(mess.ModelerMessage)
        # other objects under mess to get IDs of problem geometry