pyRevit icon indicating copy to clipboard operation
pyRevit copied to clipboard

Add option to "Toggle All Grids Bubbles" to toggle bubbles at the sides of the view (top|bottom, left|right)

Open eirannejad opened this issue 1 year ago • 6 comments

From pyRevit fan:

"toggle all grids bubbles in current view" is it possible to choose either the top bubbles on the sheet or bottom bubbles on the sheet to turn a whole set of those on or off? Or is the only option is to turn all of the grids on or off regardless of if they're on top or bottom, left or right?

eirannejad avatar May 08 '24 21:05 eirannejad

No directionality implemented in the code https://github.com/pyrevitlabs/pyRevit/blob/master/extensions/pyRevitTools.extension/pyRevit.tab/Drawing%20Set.panel/views.stack/Views.pulldown/Toggle%20All%20Grid%20Bubbles%20in%20Current%20View.pushbutton/script.py

All on or off. Closest and easiest thing would be to add option for end0 or end1, but that would all depend on what was the first and second drawing point.

jmcouffin avatar May 09 '24 20:05 jmcouffin

not fully automated , but flipping grids much easier using multi-selections.

doc = revit.doc
active_view = doc.ActiveView

grids = revit.get_selection()

if not grids:
    forms.alert('No Grids selected!', exitscript=True)
end_0 = []
end_1 = []

with revit.Transaction('Flip Grids'):
    for grid in grids:
        # Define Ends
        end_0 = grid.IsBubbleVisibleInView(DB.DatumEnds.End0, active_view)
        end_1 = grid.IsBubbleVisibleInView(DB.DatumEnds.End1, active_view)

        if end_0:
            grid.HideBubbleInView(DB.DatumEnds.End0, active_view)
        else:
            grid.ShowBubbleInView(DB.DatumEnds.End0, active_view)

        if end_1:
            grid.HideBubbleInView(DB.DatumEnds.End1, active_view)
        else:
            grid.ShowBubbleInView(DB.DatumEnds.End1, active_view)

tay0thman avatar May 13 '24 20:05 tay0thman

Hi guys,

I found a good workaround with the curve endpoints, they match the DatumEnds (0|1) Have to deal with the view orientation now...

ToggleGrids

MohamedAsli avatar Jun 26 '24 23:06 MohamedAsli

I plan to enhance the "Toggle All Grids Bubbles" feature by including an option to control bubble visibility at the top, bottom, left, and right sides of the view. My experience with UI design and toggle functionalities makes me well-suited for this task. This improvement will give users greater customization and improve overall usability

Qu3st-9000 avatar Jun 06 '25 23:06 Qu3st-9000

Thanks @Qu3st-9000 Let me know if you have questions along the way.

jmcouffin avatar Jun 07 '25 05:06 jmcouffin

@Qu3st-9000 Can't wait for your PR! Thank you for taking the initiative.

tay0thman avatar Jun 10 '25 07:06 tay0thman