Issue with Python Script

Hi All,

I am trying to learn and understand python script. I find this script that can allow me to place a family in the reference plane. But the issue is it shows an error when in the python script I would be grateful if anyone can help me to solve this issue.

Python.dyn (4.2 KB)


import clr
import Revit
from Revit.Elements import *
from System.Collections.Generic import *
from Autodesk.Revit.DB import *
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
#The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN
symbol = UnwrapElement(IN[0])
refPlane = UnwrapElement(IN[1])
location = UnwrapElement(IN[2])
referenceDirection = UnwrapElement(IN[3])
out = []

reference = Reference(refPlane)


new = doc.Create.NewFamilyInstance(reference,location.ToXyz(),referenceDirection.ToXyz(),symbol)


#Assign your output to the OUT variable.
OUT = new

Looks like you’re trying to get it to read an empty list or a zero value.

Maybe you need a loop… Bit hard to tell with the info you’ve given.

Try feeding out the thing you’re asking it to “Activate” (I’m not aware of that command either).


So I think it’s to do with your family? I just made a face based generic model and it worked (when I put the ‘activate’ in the transaction).

Hope that helps,


1 Like

Hello @Mason.Tabrizi
you have an error because there is nothing connected to the inputs (Python Node)
here some resources for you

1 Like