Ruby API pushpull behavior - cannot replicate manual behavior

This is an issue I have raised before with no results: the API methods are inconsistent regarding which ones do or do not trigger SketchUp’s cleanup operation (which generates intersections, removes duplicates, etc.). It is not documented which do and do not trigger cleanup. Further, there is no method in the API by which one can explicitly request cleanup.

I can easily understand why one might want to defer cleanup until the end of generating a large suite of geometry, as it is sometimes a slow operation (there have been numerous posts about how add_face can be slow). But I can equally see why there are times when you want cleanup because it is otherwise hard and/or obscure to see how to achieve a desired result (the subject of this topic).

From the developers’ perspective, a do_cleanup method would be high on my wish list of additions to the API.

Thank you for the clarification. However, I did try adding it to phys_sel.parent.entities, and this didn’t solve the problem. Only Jim’s method did.

If the way I did menu registration is not proper, then please blame the tutorials.

Nobody is blaming you, and it is well known for us that the tutorials/docs are everything but good (and it would benefit the atmosphere of the discussion if we have less strong feelings and focus on solving the matter of the topic.)

Catching errors in commands or tool methods is not really common, but a good tip that ensures that mistakes in the code will not stay silent. This can save (especially learners) many hours wondering why the plugin does nothing or not what expected.