I’ve been asked to create a script that can find all of the holes in a model. I can do that fairly easily, however there are two issues for which I could not find a solution:
When selecting cylinders using rs.IsCylinder() I’m also capturing fillets. Is there a way to only select cylinders that are complete (360°)?
I would also like to capture the bottoms of the blind holes, but I really doubt that’s possible as the bottoms do not have enough uniqueness to make them different from other surfaces. Any suggestions? I don’t have much hope for this one.
I see this works on individually selected surfaces, but what if I want to select the whole model? I notice that the obj_ref.Surface() fails if trying to iterate through numerous surfaces with the message:
Do do this correctly, you’re going to need to dig through the Brep topology looking for inner loops, or where BrepLoop.LoopType == BrepLoopType.Inner. From here, there is a bit of work to determine the loop’s trim curve references edges that have an outer loop.
I’ve added a sample that lets you pick holes like the MoveHole command does. Perhaps this code is of interest to you.