Grid bubble on/off

Hello all,

I am trying to turn off all bobbles in the lower left and turn on all bobbles in the top right. I have developed a scrip to determine what end of the grid is in this location. I have tried the different methods show in this thread but cannot get them to work.

@Ben_Osborn post seamed the most promising. Works off an intersection point of a line and the grid. I fed in the end points of the side I want to turn off but it is turning off the heads on both sides. Does anyone know why this is happening?

Grid Bubbles on or off.dyn (21.0 KB)


Ok I got it to mostly work but now I am confused at the outcome. I got it to turn on the grid bobbles on one end and off on the other. This is the most I have ever done in python so I might have messed up the IF statement but I am not sure.

before I run the script

After script is ran

Some of the grid bobbles are flipped from the others. I am not sure why this is happening.

import clr
from Autodesk.DesignScript.Geometry import *

import Revit


import RevitServices

from RevitServices.Persistence import *
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *

import Autodesk
from Autodesk.Revit.DB import *

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

a = UnwrapElement(IN[0])
b = UnwrapElement(IN[1])
v = UnwrapElement(IN[2])

for i in a:
	if b:


OUT = a

Any help is much appreciated.

Grid Bubbles on or off2.dyn (14.6 KB)

@Steven why can’t you use @Ben_Osborne script?

I think you get that result because of the way grids were drawn.

His was not turning the bubbles off and on correctly. I know the end being turned off or on depends on what direction the grids were drawn. This is why I got the end points and added the X and Y to find which end is in the top right eliminating the problem of the direction.

I will have to do more testing on Ben’s it could have been that Grid.Curve was getting the whole grid line rather than the 2d crop. Then the points would not have been lying on the grid line in the view. (just thought of this as I was typing my response).

Solved the problem in another post. Please see link below for the code in the python node. Thanks @Lknapton for providing the base of the code (99% of it) and @Nick_Boyts for helping with the IF statement.

just noticed that dependent view won’t work, any solution?