Skip to content

Commit 3b6b42d

Browse files
authored
Merge pull request gtalarico#17 from 2adicted/patch-1
Snippets_ToggleLevelBubbles
2 parents 660d984 + f91ffea commit 3b6b42d

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
Toggle the visibility of the Level Bubble in Section/Elevation
3+
The snippet can be reused for Grids
4+
TESTED REVIT API: 2018
5+
The snippet can be used as is in a Revit Application Macro for test purposes
6+
Author: Deyan Nenov | github.com/ArchilizerLtd
7+
This file is shared on www.revitapidocs.com
8+
For more information visit http://github.com/gtalarico/revitapidocs
9+
License: http://github.com/gtalarico/revitapidocs/blob/master/LICENSE.md
10+
*/
11+
12+
public void ToggleLevelBubbles()
13+
{
14+
Document doc = this.ActiveUIDocument.Document;
15+
Selection sel = this.ActiveUIDocument.Selection;
16+
17+
do
18+
{
19+
//Pick the Level you want to toggle in Elevation/Section
20+
Level lvl = doc.GetElement(sel.PickObject(ObjectType.Element, "Pick View to Align To")) as Level;
21+
22+
using(Transaction t = new Transaction(doc, "toggle"))
23+
{
24+
t.Start();
25+
lvl.HideBubbleInView(DatumEnds.End0,doc.ActiveView); //DatumEnds.End1 to toggle the other End
26+
t.Commit();
27+
}
28+
}
29+
while(true);
30+
}

0 commit comments

Comments
 (0)