Scripting the Trim command

 From:  Michael Gibson
8786.31 In reply to 8786.30 
Hi Brian, thanks for posting the file.

So when doing this:

code:
var trim_res = trim_factory.getCreatedObjects().item(0);


The 'trim_res' object is the full brep which for the cone will now have 3 edges - the original "seam edge" plus 2 edges from the closed edge that was trimmed. The cylinder started with 3 edges (2 closed edges at the ends and one seam edges), and when you trim one of those in half there will now be 4 edges.

Probably the thing that's got you tripped up is you were expecting to receive edges as the output, but when you trim an edge the output is a brep.

So yeah probably tagging the edge with a name before trimming it would be good so you could find the new edges when looking through all the brep's edges. The name should inherit into the trimmed pieces.

- Michael