Python and Data-Shape Nodes

Hi guys, first of all, thank you for everyone’s contribution to the forum. I’ve been able to learn a lot of Dynamo in the past year or so mainly by looking for solutions in the already existing posts. with that being said, I have a Working Script I’m trying to use along with the Data-Shapes node however once I started implementing the Data Shape UI the Python portion of the workflow doesn’t seem to work properly. Here’s the graph:

Python

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.HideBubbleInView(DatumEnds.End0,v)
else:
g.ShowBubbleInView(DatumEnds.End0,v)
g.HideBubbleInView(DatumEnds.End1,v)

TransactionManager.Instance.TransactionTaskDone()

doc.Regenerate()

OUT = g

If I bypass the UI block and connect one of the quadrants directly to the Python node the action works flawlessly:

2021-11-17 - Control Grid Bubbles - GIF

Any idea how can I fix either the workflow or the Python Node so I can use the Data-Shape UI?

Thanks in advance!

I found the solution!! The list had to be flattened before feeding the Python node. Thanks