I was a little confused when you said they are Shared Parameters, but I looked at my screenshot above and that was the case.
They are actually just normal family parameters though. I’m not sure why GH reported them as Shared.
try this:
for param in ct:
family_manager.MakeType(param)
hmm. still not converting the parameters. it’s weird that there’s no error message if it’s not accessible.
I think your parameters are not shared parameters. I hope the following will work.
import clr
clr.AddReference("RevitAPI")
clr.AddReference("RhinoInside.Revit")
from RhinoInside.Revit import Revit
from Autodesk.Revit import DB
doc = Revit.ActiveDBDocument
family_manager = doc.FamilyManager
family_params = list(family_manager.Parameters)
if Create == 1:
t = DB.Transaction(doc, "Change Scope")
t.Start()
try:
for param in family_params:
if param.IsInstance:
family_manager.MakeType(param)
t.Commit()
print("All instance family parameters have been converted to type parameters.")
except Exception as e:
print("Error converting family parameters:", e)
t.RollBack()
2 Likes
Success! Thanks so much! This will save me hours.
PS: I looked you up and found you have courses/subscriptions. That’s pretty interesting to me and I will bring it up to my leadership.
Really appreciate the help!
2 Likes