AdaptiveComponent.ByPoints with Python

Hello everyone,

I am trying to place a 2-point adaptive family with a Python node and I am struggling with the following issue:

# Load the Python Standard and DesignScript Libraries
import sys
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

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

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from System import Array
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
# The inputs to this node will be stored as a list in the IN variables.
bool = IN[0]
points = IN[1]
family = UnwrapElement(IN[2])

a = []
# Place your code below this line
if bool == True:
    for i in points:
        lst = Array[Array[i]]
        b = Revit.Elements.AdaptiveComponent.ByPoints(lst,family)
# Assign your output to the OUT variable.
OUT = b

Does anyone know hot to solve it?

Thank you in advance.

Hi @JMCiller

as i can see you pass a family to the python script. The node AdaptiveComponent.ByPoints takes a family type not a family.

1 Like

@Meychik That is correct.
Also line 31 is wrong.

And a nested list of two X,Y, Z coordinates per sublist