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.

To Show or Hide the Grid Bubble of a grid line Individually, it is possible to do this graphically inside a view.
- Open any view that displays the grid lines
- Select the grid line that has to be modified
- 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.
- Repeat this process for each of the grid ends and grid lines

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.
- Open any view that displays the grid lines
- Select any of the grid lines
- Go to the Properties browser and click on Edit Type

- Optional: create a new type by Duplicating
- Now choose whether you want to show or hide the Grid Bubbles at each end > Click Apply/Ok

- 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.

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

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.

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).

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.

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.

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

# 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”.


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.
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.
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.
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. 🙁
You can download the file from my Github repository: https://github.com/Ralph-LazyBim/LazyBIM/blob/main/Dynamo%20Files/Show%20Hide%20Grid%20Bubbles.dyn
Thank you so much! I have saved the files.
However, I can’t open the .dyn file in Dynamo.
Maybe I saved it in a wrong way? I right clicked on the dynamo file -> save as.
I think you downloaded the file in the wrong way. You can download the .dyn file by using the: Download raw file button in the upper right corner. But you have to sign in to Github first if you only want to download this file. Another way is to go to this link: https://github.com/Ralph-LazyBim/LazyBIM go to the “Code” button in the upper right corner and then download the .zip file.
Hé Ralph,
We have corresponded via email for the past weeks. But I no longer have access to that email account. So if you’ve sent me a message after the 29th of May, I unfortunately can’t see it.
That is why I’m placing this new comment! So you can find me. =)
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 🙂