, Edge<6>, etc. # We'll pick one edge that is definitely a sharp top edge: edge_name_to_fillet = "Edge<6>" target_edge = part_obj.GetEdge(edge_name_to_fillet) # Apply a constant fillet of 2 mm to that sharp edge part_obj.AddFillet("MyFillet", target_edge, 2.0, False) print("F"> , Edge<6>, etc. # We'll pick one edge that is definitely a sharp top edge: edge_name_to_fillet = "Edge<6>" target_edge = part_obj.GetEdge(edge_name_to_fillet) # Apply a constant fillet of 2 mm to that sharp edge part_obj.AddFillet("MyFillet", target_edge, 2.0, False) print("F"> , Edge<6>, etc. # We'll pick one edge that is definitely a sharp top edge: edge_name_to_fillet = "Edge<6>" target_edge = part_obj.GetEdge(edge_name_to_fillet) # Apply a constant fillet of 2 mm to that sharp edge part_obj.AddFillet("MyFillet", target_edge, 2.0, False) print("F">
def valid_fillet_example():
    # Create a new part named "BlockForFillet"
    part_obj = Part("BlockForFillet")

    # Create a simple rectangle on the XY-plane
    xy_plane = part_obj.GetPlane("XY-Plane")
    sketch = part_obj.AddSketch("SketchBlock", xy_plane)
    # 40×20 rectangle
    sketch.AddRectangle(0, 0, 40, 20, False)
    
    # Extrude the rectangle to 10 mm height
    part_obj.AddExtrudeBoss("BlockExtrusion", sketch, 10, False)

    # Enumerate edges to see what edges exist
    edges = part_obj.GetEdges()
    for i, e in enumerate(edges):
        print("Index:", i, "Name:", e.Name, "Length:", e.Length)

    # Suppose from the printout, we see that the top edges might be Edge<5>, Edge<6>, etc.
    # We'll pick one edge that is definitely a sharp top edge:
    edge_name_to_fillet = "Edge<6>"
    target_edge = part_obj.GetEdge(edge_name_to_fillet)

    # Apply a constant fillet of 2 mm to that sharp edge
    part_obj.AddFillet("MyFillet", target_edge, 2.0, False)
    print("Fillet succeeded on a valid sharp edge:", edge_name_to_fillet)

# Example usage:
valid_fillet_example()