Change the Group of a Parameter in a family document

Hi! I am trying to change with dynamo the group that a parameter is in. i can access the parameter’s values, names, id and group but i cannot seem to be able to change the value that determine under which group that parameter should be listed.(PG_IDENTITY_DATA > PG_TEXT)

The idea would be to change the group of parameter_2 from Identity Data to Text.
thanks in advance

@v.sanchezmadrigal ,

Hello,

i come until here

import sys
import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *

clr.AddReference('System')
from System.Collections.Generic import List

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

family = FilteredElementCollector(doc).OfClass(Family).FirstElement()
family_type_ids = family.GetFamilySymbolIds()
family_types = [doc.GetElement(id) for id in family_type_ids]
param_list = doc.FamilyManager.GetParameters()


OUT = family,family_type_ids,family_types, param_list

i can list the parameters

Hi Draxl_Andreas, thanks for your reply, i have the same problem i can retrieve the Autodesk.Revit.DB.Familyparameter and its values but i cannot seem to find a way to change their parameter group so they are grouped under a different one. i would love to hear if you have any ideas about it! thanks again

1 Like

@v.sanchezmadrigal ,

i can`t call them in a family enviroment, thats weard

i can list my parameters but not snooping them like

p = param_list.get_Parameter("Parameter_1")
x = param_list.LookupParameter("Parameter_1")
import sys
import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *

clr.AddReference('System')
from System.Collections.Generic import *

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

family = FilteredElementCollector(doc).OfClass(Family).FirstElement()
family_type_ids = family.GetFamilySymbolIds()
family_types = [doc.GetElement(id) for id in family_type_ids]

param_list = doc.FamilyManager.GetParameters()
identifiers = [p.Definition.GetGroupTypeId for p in param_list]
names = [p.Definition.Name for p in param_list]
Groups = [p.Definition.ParameterGroup for p in param_list]
Categories = doc.Settings.Categories
CategoryId = [c.Id for c in Categories if c.CategoryType == CategoryType.Model]
catId = List[ElementId](CategoryId)
filter = ElementMulticategoryFilter(catId)
col = FilteredElementCollector(doc).WhereElementIsViewIndependent().WhereElementIsNotElementType().WherePasses(filter).ToElements()
Instance_params = [x.Parameters for x in col]

OUT = names, Groups
1 Like

Yes! that is exactly what i was refering to, they can be read but modifiying their group seems to be a whole different story.
I also can’t understand how they are built and how the group is defined in them or if it can be changed. By logic the type of parameter should not be changed for example from text to number, but why couldn’t the group they belong to be changed?
thanks so much for trying tho!

@v.sanchezmadrigal try this, run it only once per Dynamo session, Orchid and GeniusLoci packages are used:

2 Likes

Hi @Elie.Trad Thanks for your reply, the situation with this orchid node is that it only takes family parameters and the ones i am trying to change are Shared parameters. do you have any further ideas? thanks in advance