@george we have put effort into upgrading the CPython3 project to a new engine: PythonNET3 which is currently on the package manager, and will become the base implementation in the future. It seeks to bring much closer parity between IronPython and CPython.
However, it’s gated to versions of Dynamo 3.3 and above.
There is an experimental (Read: Not being actively worked upon or updated) IronPython3 we also put on the Package Manager - if in a version earlier than Dynamo 3.3 you could try it?
It is working on Revit 2024.2
However I noted this was not exposed initially for CPython3 or IronPython2 using the dir function of python - then I installed latest version of Revit Lookup here and it appeared after relaunch EDIT I don’t think it requires Revit Lookup, I also changed my filtered element collector - just check is the method is available like this "GetRefGridLines" in dir(panel)
import clr
clr.AddReference("RevitServices")
from RevitServices.Persistence import DocumentManager
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
def get_refgrids(panel):
# Get grids using GetRefGridLine method
grids = panel.GetRefGridLines(ElementId.InvalidElementId, ElementId.InvalidElementId)
return [doc.GetElement(id) for id in grids if id and id != ElementId.InvalidElementId]
bic = BuiltInCategory.OST_CurtainWallPanels
panels = FilteredElementCollector(doc).OfClass(FamilyInstance).OfCategory(bic).ToElements()
OUT = map(get_refgrids, panels)
Thank you for the help as well!
I will try for now to stick with the default CPython3 engine, used on Revit 2024.
If I can’t solve this issue with it, then I will try the engines you suggested. Nevertheless, thank you the help.
Thank you very much for the patience @c.poupin and help.
So it is the second case from the link you provided.
Just there is a bug in PythonNET2.5, and it requires void output as well?
Or did I misunderstand you?
@solamour , so at this point, it is not clear if PythonNET3 will be the default Python engine for Revit 2026?
Or is it too late for Revit 2026, and PythonNET3 may be default engine from 2027 onwards?
Because we are not yet complete, we will retain PythonNET3 as a package for the 2026 versions of host applications like Revit, and for 2027 series it will become the base. This allows flexibility during the change, but also allows us to update it out-of-band with Dynamo updates to ensure we get it right