I’m relatively new to Dynamo and especially Python. I am trying to get a grasp on how to create a python script block that will take the currently selected element in the model and get the element ID, so I can put it through other functions (e.g., get/set parameter of element(s)). I have done some searches, and found some solutions that I have tried to replicate. However, I run into an error with the GetElementIds method, which tells me that it needs an input. Everything that I have found online, showed that there was no input necessary. Does anyone know where I might be going wrong?
from Autodesk.DesignScript.Geometry import *
from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import *
from RevitServices.Persistence import DocumentManager
pyt_path = r’C:\Program Files (x86)\IronPython 2.7\Lib’
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
adoc = doc.ActiveView
uidoc = uiapp.ActiveUIDocument
sel = Selection.Selection.GetElementIds()
Any help/guidance/advice would be greatly appreciated!