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
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
a = UnwrapElement(IN[0])
b = UnwrapElement(IN[1])
v = UnwrapElement(IN[2])
TransactionManager.Instance.EnsureInTransaction(doc)
for i in a:
if b:
i.HideBubbleInView(DatumEnds.End1,v)
i.ShowBubbleInView(DatumEnds.End0,v)
else:
i.HideBubbleInView(DatumEnds.End0,v)
i.ShowBubbleInView(DatumEnds.End1,v)
TransactionManager.Instance.TransactionTaskDone()
doc.Regenerate()
OUT = a
Any help is much appreciated.
Grid Bubbles on or off2.dyn (14.6 KB)