Prevent deletion of objects not visible in the viewport?

Hello, is there a way to prevent deletion of any object that’s outside the visible portion of the active viewport? Accidental deletion of distant selected objects not currently seen in the viewport is something that many people would like to avoid, because it can lead to loss of an important work that’s discovered too late.

Cheers,

Bobi

Hi Bobi - no, none that I know of … maybe make your Delete > Zoom Selected Delete , then you can at least tell if something unexpected was selected and Undo.

-Pascal

Hi Pascal, do you think that there is any chance for a “Safe delete” option to be implemented in Rhino 7 to prevent accidental deletion of objects outside the viewport? :slight_smile: I can see that it may not be of great priority for the “McNeal” team due to the huge list of other improvements that wait for implementation. Just asking.

Hi Bobi - I do not think this will get any traction for V7, to be honest; this is the first time in… nearly 20 years, that I can think of, that this has come up… I don’t mean to say it is a bad idea or anything, but it is one that I’d be reluctant to push very hard for, myself, in the absence of more of a ‘clear and present danger’… or a groundswell of support for the idea.
here is some quick python - you can test it and see if it is really helpful. I do not know how relaible the check for visibility is.

    ids = rs.SelectedObjects()
    if not ids:
        rs.GetObjects("Select objects to delete")
    if ids:
        rs.EnableRedraw(False)
        for id in ids:
            if rs.IsVisibleInView(id):
                rs.DeleteObject(id)
                
        rs.EnableRedraw(True)

DeleteIfVisible.py (404 Bytes)

-Pascal