How to catch the 'Recompute failed! Please check report view.' error

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
xc22143
Posts: 139
Joined: Fri Dec 03, 2021 9:52 am

How to catch the 'Recompute failed! Please check report view.' error

Post by xc22143 »

Hello, everyone.
I write a function to pad a sketch.

Code: Select all

def pad(profile, direction, length):
        pad = myobj.newObject('PartDesign::Pad', 'Pad')
        pad.Profile = profile
        pad.Length = length
        pad.UseCustomVector = 1
        pad.Direction = direction
        FreeCAD.ActiveDocument.recompute()
        profile.Visibility = 0
I tried to use 'try: except' to catch the exception, but the 'Recompute failed! Please check report view.' still pops up.
Now I want to catch the exception when the profile couldn't be padded and delete the 'myobj.newObject('PartDesign::Pad', 'Pad')'.

What should I do? Thank you!
Post Reply