Get shared parameters from file nodes not working

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


Please check shared parameter .txt ???
what about error message on dynamo node?

Here is the error on the node. the shared parameter file is correct and its opening the file. but it cant get the groups.

Can you please give me the script to check the version. i dont know python. i am just using AI to help me find the problem.

no module is pythonnet when you try: import pythonnet

to get pythonnet version just type: clr._version_

Can you share .txt file, I think problem in your file
Line 28: if spfile = app.OpenSharedParameterFile() Succeeded will return DefinitionFile

→ Line 34 you can get Groups, that is properties of DefinitionFile

GP_SharedParameters.txt (50.0 KB)

the file is correct. in revit 2023 the same file is working. and the same script is also working in rvt2023 and with ironpython2.

with rvt25 and cpython, its not working

I think i have some problem with my settings. i dont know. its not reading the Group property.

If you don’t know Python :snake: i would first look if there is any Package which has nodes
for the things you want to achieve before fiddling with AI.

You are correct but i am stuck at getting the shared parameters definitions from the file.

I used all the mentioned packages and none of them is providing the result.

I am using Revit2025

I tested with your .txt file and worked on Revit 2025 (v25.1.0)
Dynamo Core 3.0.3
pythonNet 2.5.2
Cpython 3.9.12

to check version pythonNet and Cpython, change last text to :

OUT = definitions, definition_names, "pythonNet is : " + clr._version_,"CPython is : "+ sys.version

I dont know why but you can try:
・Disable all another addin then try run dynamo again (maybe conflict)
・Update new hotfix of Revit2025 (now latest is 2025.4.6)

Autodesk Revit 2025 Product Updates

I removed all the packages and reinstalled them. now its working. thanks