Sorry to revisit this old post.
I am using a very similar code, in fact, the only difference in my code is the variable names and some formatting.
But I am getting the error message:
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 32, in
Exception: Error code: 5
I have changed my code to match your entirely. Bu added an iteration over a list to create multiple instances as I am populating a surface.
What is even weirder is the fact that this code was working fine.
I have rebooted my computer and have no Idea of what could possibly be happening.
I cannot find anywhere what error code 5 means and importing the traceback module fails. So I can’t read specifics on the exception.
that is my code:
from Autodesk.DesignScript.Geometry import *
from Revit.Elements import *
from System.Collections.Generic import *
from Autodesk.Revit.DB import *
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
refPlane = UnwrapElement(IN)
points = UnwrapElement(IN)
refDir = UnwrapElement(IN)
symbol = UnwrapElement(IN)
for point in points:
newFam = doc.Create.NewFamilyInstance(refPlane.GetReference(), XYZ(point.X, point.Y, point.Z), XYZ(refDir.X,refDir.Y,refDir.Z), symbol)
#Assign your output to the OUT variable.
OUT = newFam