Get all Grid in Model.

Get all Grid in Model.

anhtrung
Advocate Advocate
1,954 Views
1 Reply
Message 1 of 2

Get all Grid in Model.

anhtrung
Advocate
Advocate

Hi all,

 

Can every body help me that is want get all Grid from Elevation and Plan in model with C.#.

 

How to do for that ?

 

Thank so much.

0 Likes
Accepted solutions (1)
1,955 Views
1 Reply
Reply (1)
Message 2 of 2

matthew_taylor
Advisor
Advisor
Accepted solution

Hi @anhtrung,

This should do it.

Dim col As DB.FilteredElementCollector = _
New DB.FilteredElementCollector(doc) _ .WhereElementIsNotElementType _ .OfCategory(DB.BuiltInCategory.OST_Grids)
docUi.Selection.SetElementIds(col.ToElementIds)

If you want them just for a specific view, then use:

 

DB.FilteredElementCollector(doc, view.Id)


Cheers,

-Matt
_______________________________________________________________________________
Marking a post as a 'solution' helps the community. Giving a post 'Kudos' is as good as saying thanks. Why not do both?
0 Likes