Grids selection from Revit

Hi,
Is there a node to select multiple grids from Revit ?
I just found “Select model elements” , didnt find select datum elements.
maybe there is a python code that do it?

thanks :slight_smile:

Hi @rinag,
Do you want to select a specific amount of grids or ALL grids in the project?
If specific, “Select Model Elements” is the best suitable node for that.
For all grids you can use “Categories” with Grids as the chosen category and “All Elements of Category” to retrieve all elements of the category. :slight_smile:

1 Like

Its possible to turn them on or off for example.

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)

clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference("RevitServices")
import RevitServices

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

clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

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

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

TransactionManager.Instance.EnsureInTransaction(doc)

for g, b in zip(g, b):
	if b:
		g.ShowBubbleInView(DatumEnds.End1,v)
		g.ShowBubbleInView(DatumEnds.End0,v)
	else:
		g.HideBubbleInView(DatumEnds.End0,v)
		g.HideBubbleInView(DatumEnds.End1,v)
	
TransactionManager.Instance.TransactionTaskDone()

doc.Regenerate()
1 Like

Hi,
I used “select model elements” but when i try to set the parameter of symbol end but i got error,
do u know the correct parameter name i should set to show/hide bubble for specific grids?

The “Plan View Symbols End 1(Default)” Should be true or false.

Example:
true;
true;

It will put both bubbles of the grid to true or false per grid.

1 Like

i believe these two parameters you are looking for is builtin parameter. they going by the name of “Symbol at End 1 Default” and “Symbol at End 2 Default”. i dont think you can toggle it on and off through this method as they are type parameter(?), correct me if im wrong :smiley:

yes why i got an error : “No parameter found by that name.”

Try this:

The true will put all bubbles on for selected grids.

1 Like

great , i works but its hide/show the two ends of grid , i need to hide just one side

i got it , just remove both lines of “g.ShowBubbleInView(DatumEnds.End0,v)”

Hide 1 side was my original idea to… but this is tricky because the side is decided by how the grid is drawn… so if you draw some grids bottom to top and some grids top to bottom. its hard to turn on all bottoms for example.

1 Like

This might help :

1 Like

@Revit_Noob This method only works when you draw your grids the same way. (from top to bottom for example.)

1 Like

I Try it with select model elements instead of all elements of grid category, then i got error “No parameter found by that name”
image

I believe that is because in @Kulkul’s example, he is getting the ElementType and setting the parameter of that ElementType, not the instance as you have done.The Element and the ElementType have different parameters, so be mindful which one you are using. :blush:

1 Like

could u please tell me why its not working on levels bubble?

element type and not element.

Hi @rinag

How about hiding Levels and Grids by its category in active view?

2 Likes

@Kulkul Could you show us what the What the python script is?
This is exactly what I have been looking for. :heart_eyes: