Hi Everyone,
I am trying to add shared parameters to the family documents. I want to read the shared parameters from the file. This code/Node from data shapes was working for me in Revit2023 and Ironpython2. I have the latest package installed now for rvt25
but when i run my script now in Revit2025 and Cpython. its giving me error. The Node itself was giving null output. I copied the python code from the Node and run it and its giving me this error. see below
Its not about this node only but the nodes from other packages like crumble is also giving me the same error msg. How can i solve this problem?
alot of packages that were working in Revit2023 are not working for me now in Revit2025. Although i changed them from ironpython to cpython.
"
Node Name: Python Script
Original Node Name: Python Script
Package: Core.Scripting
Dynamo Version: 3.3.0.6316
Host: Dynamo Revit
Messages: AttributeError : ‘DefinitionFile’ object has no attribute ‘Groups’ [’ File “”, line 34, in \n’]
State: Warning"
The same method if use in the ironpython shell, is working.
# Copyright (c) mostafa el ayoubi
# Data-Shapes www.data-shapes.net 2016 elayoub.mostafa@gmail.com
# Ported to CPython + PythonNet 2.5
# Compatible with Revit pre-2025 and 2025+
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *
doc = DocumentManager.Instance.CurrentDBDocument
uidoc = DocumentManager.Instance.CurrentUIDocument
app = doc.Application
# Input: path to shared parameters file (.txt)
shared_param_file_path = IN[0]
# Set the shared parameters file path
app.SharedParametersFilename = shared_param_file_path
# Open the shared parameter file
spfile = app.OpenSharedParameterFile()
if spfile is None:
OUT = [], []
else:
# Get all definition groups
groups = spfile.Groups
# Get all definitions from all groups
definitions = []
definition_names = []
for group in groups:
for definition in group.Definitions:
definitions.append(definition)
definition_names.append(definition.Name)
# Output: definitions (for use with ds_add_shared_parameters_to_project_v2)
# definition_names (for display/filtering)
OUT = definitions, definition_names







