How to Turn Off Multiple Grid Bubbles in Revit

Grid lines are used to indicate where building elements are placed, mostly aligned with the primary structural elements. They help organize your design. After placing them, each of the grids will indicate a coordinate which will be shown inside the Grid Bubble. These Grid Bubbles can be turned on or off in Revit, depending on your needs.

In Revit, grids are categorized as annotation elements. The grids are mostly placed vertically and horizontally. When used on sheets, you often want to turn all grid bubbles on or off. This can be time-consuming, but luckily we can automate this!

This article will show you how to turn off multiple grid bubbles with different methods but in particular how to automate this with the help of Dynamo Revit.

Grid Bubbles

To Show or Hide Grid Bubbles there are mainly two methods that are available in Revit. The first method is to show or hide the grid bubble individually, which is a tedious and time-consuming task. The second method is by using the Type properties, which will turn off all grid bubbles simultaneously. With this method, you have to work with different types, making you less flexible.

But what if you want to be more flexible with the Grid Bubbles? There is a way to turn all Grid Bubbles on or off simultaneously, without changing the type properties. This can be done by using a Dynamo script in Revit.

Before we continue to explain the Dynamo Script to Show and Hide Multiple Grid Bubbles, we start explaining the methods that can be used in Revit self.

Method 1 – Graphically and Individually

In Revit, it is possible to control the Grid Bubbles at both ends of the grid line. In Non-Plan views, such as elevations and sections you can control the Top and Bottom Grid Bubbles.

turn off grid bubbles revit


To Show or Hide the Grid Bubble of a grid line Individually, it is possible to do this graphically inside a view.

  1. Open any view that displays the grid lines
  2. Select the grid line that has to be modified
  3. Next to the Grid Bubble you will see a check box, Uncheck the check box to hide the Grid Bubble, or select the check box if you want to show the Grid Bubble.
  4. Repeat this process for each of the grid ends and grid lines
turn off grid bubbles individually
Show or Hide Grid Bubble individually

Tip

If you can’t find the check box to Show or Hide the Grid Bubble, try to zoom in or out to see it properly.

Method 2 – Type Properties

When it comes to turning off Multiple Grid Bubbles at once in Revit, there is the possibility to control this by using the Type properties. With this method, you can make multiple types, allowing you to control the Grid Bubbles.

  1. Open any view that displays the grid lines
  2. Select any of the grid lines
  3. Go to the Properties browser and click on Edit Type
revit turn off multiple grid bubbles
  1. Optional: create a new type by Duplicating
  2. Now choose whether you want to show or hide the Grid Bubbles at each end > Click Apply/Ok
grid type properties
  • Plan View Symbols End 1: To Show (check) or Hide (uncheck) a Grid Bubble at the start point of the grid line.
  • Plan View Symbols End 2: To Show (check) or Hide (uncheck) a Grid Bubble at the endpoint of the grid line.
  • Non-Plan View Symbols: To Show or Hide a Grid Bubble in views such as Elevations and Sections. In this case, you can choose from Top, Bottom, Both, or None.
revit turn off multiple grid bubbles
Turn off multiple grid bubbles by using type properties

Dynamo – Turn Off Multiple Grid Bubbles

Now that it is clear how to turn the Grid Bubbles on or off with the methods in Revit, let’s take a look at how to automate this with the help of a Dynamo Script. The script can be used to control the Grid Bubbles in a single view, but also with multiple views that are placed on the sheet.

Dynamo – Script

Below you will see an overview of the Dynamo script. I have divided the script into five parts to make clear what each part does. Also, the script contains a part that is made in Python.

The script requires the installation of the following package:

  • Clockwork for Dynamo 2.x
dynamo turn off multiple grid bubbles

1. Get Active View

The first part of the script checks whether a single view or sheet is opened. A sheet mainly contains multiple views. The Active View is controlled by a Boolean which serves as a switch to turn the Grid Bubbles on or off.

dynamo get active view

2. Collect Single View

When the Active View contains a single view, this will be collected in the list. The View Type will read out what kind of view it contains. This will be used to create a filter (in part 4).

collect single view dynamo

3. Collect Multiple Views

When the Active view contains a sheet, then it will read out which views are placed on the sheet. These views are filtered into three types: Elevation, Floorplan, and Section. Notice that these are the ones that contain grids. You can modify this code block if you only like to control the grid bubbles of an elevation, for example. The filtered views are placed in a new list.

collect multiple views

4. Filter Whether Single or Multiple Views Get Through

When the Active View in part 1 is reading out: DrawingSheet (which means that there are multiple views) then it will filter all the views that are placed on the sheet. Otherwise, it will only let the single view through.

filter views dynamo

5. Turn On/Off Multiple Grid Bubbles

When the views are collected they go as input through the Python script. This script will loop through each view and collect all grids.

The first grid that is found, is used to determine if the grid bubbles are on or off. From that point, it will do the opposite to all other grids. For example, when the first grid is on, it will turn off all grid bubbles in the view, and vice versa

revit turn off multiple grid bubbles with dynamo
# Load the Python Standard and DesignScript Libraries
import clr
# Import DocumentManager
clr.AddReference("RevitServices")
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
#Import RevitAPI
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *
# The inputs to this node will be stored as a list in the IN variables.
doc = DocumentManager.Instance.CurrentDBDocument
uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
views = UnwrapElement(IN[0])
getfirstview = views[0]
annotationelements = list()
TransactionManager.Instance.EnsureInTransaction(doc)
# Variables
collgrids = FilteredElementCollector(doc, getfirstview.Id)
filtgrids = ElementCategoryFilter(BuiltInCategory.OST_Grids)
grids = collgrids.WherePasses(filtgrids).ToElements()
firstgrid = grids[0]
# Check if first grid is turned on/off.
x = firstgrid.IsBubbleVisibleInView(DatumEnds.End0, getfirstview)
# Gather all grids per view.
for view in views:
	collector = FilteredElementCollector(doc, view.Id)
	filter = ElementCategoryFilter(BuiltInCategory.OST_Grids)
	grids = collector.WherePasses(filter).ToElements()
	
	if x == True:
		for grid in grids:
			grid.HideBubbleInView(DatumEnds.End0, view)
			grid.HideBubbleInView(DatumEnds.End1, view)
			out = "Bubbles are Hidden"
	else:
		for grid in grids:
			grid.ShowBubbleInView(DatumEnds.End0, view)
			grid.ShowBubbleInView(DatumEnds.End1, view)
			out = "Bubbles are Shown"
			
	annotationelements.append(grids)
TransactionManager.Instance.TransactionTaskDone()
doc.Regenerate()
uidoc.RefreshActiveView()
# Assign your output to the OUT variable
OUT = (annotationelements, out)

The script’s output will be grids with or without Grid Bubbles inside the view(s). The Boolean can be changed to True or False to toggle between on or off. Also, the output will show a text that says: “Bubbles are Hidden”, or “Bubbles are Shown”.

turning off grid bubbles in revit view
single view with Grid Bubbles turned on or off.
turning off grid bubbles on sheet
example of a sheet with multiple views with Grid Bubbles turned on or off.

Wrapping Up

Grid lines are used to indicate where building elements are placed. This will help you to organize your design in Revit. Each grid will have a unique number or letter inside the grid bubble. Within Revit, you can show or hide these grid bubbles. You can do this individually for each line, but as you might have noticed, this is very time-consuming. The other method to do this simultaneously is by using Type properties, which makes you less flexible.

Nonetheless, it is possible to turn the grid bubbles on or off simultaneously with the help of Dynamo, which makes you more flexible and faster.

I hope this article helped you to understand how to turn off multiple grid bubbles, and how to do this with the help of a Dynamo script. If you have any questions, just drop a comment below.

Get more stuff like this

Revit, Dynamo, Sketchup and BIM Tips

I hate spam too, so you can unsubscribe at any time.

15 thoughts on “How to Turn Off Multiple Grid Bubbles in Revit”

  1. Hello Ralph,

    Thank you for the informative post! I’m new to Dynamo and trying to find a script that only shows grid bubbles on the left and top sides of a view. Is there any way you could modify your script to do this? I would really appreciate it!

    Thank you,

    Sharoon

    • Each Grid has its start and end points. So when you model each grid, from Left to Right and from Top to Bottom the start points will be at the Left and Top. With this method you can change the Python script, you only have to remove line 44, “grid.ShowBubbleInView(DatumEnds.End1, view)”. When you toggle the True/False button now, it will only Show or Hide the Grid Bubbles on the Left and Top. The Grid Bubbles on the Right and Bottom will stay hidden.

      • Thanks for the help, Ralph! I’m almost there. I removed line 38 in the “else” loop, “grid.ShowBubbleInView(DatumEnds.End1, view)”. However, when I toggle True/False, the bubbles show/hide on the LEFT and BOTTOM. I believe this means my start points are at the LEFT and BOTTOM. I know I need to modify the script to show the start point of the left to right grids and the end point of the top to bottom grids but I’m not sure how to do that. Could you help with this?

        Thank you,
        Sharoon

        • I recommend consistently modeling the grids from left to right and top to bottom. Then you can change the ends of the grids to your requirements inside the script. For now, you can try to rotate or mirror the grids (the fastest way). There is no easy way to change the script individually for this.

  2. I am looking to turn on the upper and the left grid bubbles while turning off the lower and right ones. but i would like to do all the views with one dynamo and i am having no luck doing it

    • You can remove Line 44 from the Python code, which says: “grid.ShowBubbleInView(DatumEnds.End1, view)”. This allows you to only Show or Hide the Grid Bubbles on the Left and Top while the Right and Bottom stay off (note: grids are modeled consistently from left to right and top to bottom). When you recreate the whole script, as shown in the article, you should be able to turn on/off the grids in multiple views on the sheet.

      • I don’t think I ask my question correctly , I want to run one dynamo and do all the views in the project at once. I am also a little confused by the removal of line 44 because looking at the code line 44 doesn’t seem to match what you are saying to remove. I am new at Python but I know dynamo pretty well.
        thanks for the reply

        • You can remove parts 1-4 of the script written in the article and then add a Boolean node and Python Script node. Put the Boolean into the IN[0] to toggle on or off. Inside the new Python Script node, add this code for collecting all views:

          import clr
          # Import DocumentManager
          clr.AddReference("RevitServices")
          from RevitServices.Persistence import DocumentManager
          #Import RevitAPI
          clr.AddReference("RevitAPI")
          from Autodesk.Revit.DB import *
          # Get the current Revit document
          doc = DocumentManager.Instance.CurrentDBDocument
          # Get all floor plan views in the document
          views = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Views).WhereElementIsNotElementType().ToElements()
          # Filter only the floor plan views
          floor_plan_views = [view for view in views if view.ViewType == ViewType.FloorPlan and not view.IsTemplate]
          # Assign your output to the OUT variable
          OUT = floor_plan_views

          Then connect the OUT with the IN[0] of part 5. Remove this line from part 5: "grid.ShowBubbleInView(DatumEnds.End1, view" in line 38.

          When you like to add more views such as AreaPlan, CeilingPlan, etc, change the code line like this: floor_plan_views = [view for view in views if (view.ViewType == ViewType.FloorPlan or view.ViewType == ViewType.AreaPlan) and not view.IsTemplate]

          Now your script should work fine.

  3. Can anyone send me a dyn file as a reference? I am fairly new to Dynamo and have been at this for days. I cannot seem to get the script to work. 🙁

  4. I have to say that Nicoletta’s comment is the first thing I have seen on a Revit forum that could be considered even remotely flirtatious 🙂

Leave a Comment

0 Shares
Tweet
Share
Share
Pin