I’m using Pythin within Dynamo to create some utility routines to speed up my use of Revit.
One error I come acorss a lot is something along the lines of:
TypeError: AddSet() takes exactly 2 arguments (1 given)
AddSet is an example of the error, I sometimes get it with other functions, everytime I look at the API help only one arguement is required - not two as the error states.
I believe this is because I’ve not imported something, but I’m no too sure what and how I can find it out.
Below is my code to create a SelectionFilterElement - this generates the error:
I’d appriciate some advise on whats going wrong…
# Dynamo import clr clr.AddReference('RevitAPI') clr.AddReference('RevitAPIUI') from Autodesk.Revit.DB import * from Autodesk.Revit.UI import * clr.AddReference('RevitAPI') import Autodesk from Autodesk.Revit.DB import * clr.AddReference('RevitAPIUI') from Autodesk.Revit.UI.Selection import * clr.AddReference("RevitServices") import RevitServices from RevitServices.Persistence import DocumentManager from RevitServices.Transactions import TransactionManager from System.Collections.Generic import * doc = DocumentManager.Instance.CurrentDBDocument uiapp = DocumentManager.Instance.CurrentUIApplication app = uiapp.Application uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument #The inputs to this node will be stored as a list in the IN variables. dataEnteringNode = IN elefound = UnwrapElement(IN) # A list of elements of a certain category elefound = elefound.Id filtlist = List[ElementId]() filtlist.Add(elefound) faminfil = SelectionFilterElement.AddSet(filtlist) #Assign your output to the OUT variable. OUT = [faminfil]