Hide GridBubble in View

Hello Larsa.
I dont know what went wrong in your Dynamo script. At our office we use this every day. We integrated our scripts with Dyno in Revit. Dyno - Releases and News
Anyway, i uploaded the script again. Maybe this time it will work.

<a class=“attachment"href=”//discourse-cloud-file-uploads.s3.dualstack.us-west-2.amazonaws.com/business6/uploads/dynamobim/original/3X/6/9/694b41ef6150b788e20cbe1acfb3e0faddf26d43.dyn">Toggle Grid Bubbles.dyn (11.4 KB)

1 Like

Hi,
Hmm, I still can’t get it to work, I’m really new to this Dynamo stuff. And the Dyno installation didnt work as expected either.
I get the browser, but no content in it and the sample map that they talk about in the manual does not show up.
At this rate it will be faster to just do it manually.
Thanks for the help anyway! Appreciate the effort! :slight_smile:

Im having a similar problem,
After running the script, if you click on the grid you can see that the check box is un checked but the grid head is still visible as you can see in the image below.
the scrip is working but why is the grid head still visible ??

Thanks for sharing!

As usual, it works perfectly! :wink:

I would like to share this script which toggles all the grid bubbles.
This works for a single View or for all the Views on a Sheet. Depends on which is marked as ActiveView

Toggle Grid Bubbles_.dyn (10.7 KB)

#Start Python Script

import clr
clr.AddReference("ProtoGeometry")
from Autodesk.DesignScript.Geometry import *
# Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
# Import geometry conversion extension methods
clr.ImportExtensions(Revit.GeometryConversion)
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *


doc = DocumentManager.Instance.CurrentDBDocument
uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
views = UnwrapElement(IN[0])
firstview = views[0]
elements = list()

TransactionManager.Instance.EnsureInTransaction(doc)

coll = FilteredElementCollector(doc, firstview.Id)
filt = ElementCategoryFilter(BuiltInCategory.OST_Grids)
grids = coll.WherePasses(filt).ToElements()
firstgrid = grids[0]

# controleer eerste stramien aan/uit
x = firstgrid.IsBubbleVisibleInView(DatumEnds.End0, firstview)

# verzamel alle grids per view
for view in views:
	collector = FilteredElementCollector(doc, view.Id)
	filter = ElementCategoryFilter(BuiltInCategory.OST_Grids)
	grids = collector.WherePasses(filter).ToElements()
	
	# zet bubbles aan uit per stramien
	for grid in grids:
		if x == True:
			grid.HideBubbleInView(DatumEnds.End0, view)
			grid.HideBubbleInView(DatumEnds.End1, view)
			out = "Bubbles Hidden"
		else:
			grid.ShowBubbleInView(DatumEnds.End0, view)
			grid.ShowBubbleInView(DatumEnds.End1, view)
			out = "Bubbles Shown"
			
	elements.append(grids)


TransactionManager.Instance.TransactionTaskDone()

doc.Regenerate()
uidoc.RefreshActiveView()

OUT = (firstgrid, x, elements, out)
3 Likes

can i edit the same to show/ hide level head bubbles per view

Yes. See mine topic you just saw. You can use that graph.

Hi,
I know it is a pretty old post but do u anychase have any idea if we could extend or shorten the Grid lingth when they are 2D grid. SO a similar principle like all the views in sheets where instead of hiding the Grid I want to extend out or push in all the grid bubbles by a certain distance.
Would that even be possible?

Thanks for sharing. Working fine. My only comment is that i want to be able to draw the spline in between the viewport and the annotation crop.