Built In names of the categories sorted by SP group

Hello everyone! :slight_smile:
I’d like to know if someone knows a way to estract from the model the Built In names of the categoties (that one with the prefix “OST_”) sorted by SP group…

I’m a novice and It’s several days that I’m trying to do that…without succes :frowning:

Thanks!

Hi @mixmastermich

You want to sort categories by Shared Parameter(SP)?

not exactly, by its SP Parameter Group

Do you Know if is this possible?

Yes. Could you show us your graph with all the previews on?

I’d like something like this, but this one is sorted with name parameters, i need with SP Parameter group.

the content of the python is:

import clr
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
import System
from System.Collections.Generic import List
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

builtInCats = System.Enum.GetValues(BuiltInCategory)

def getBips(bic):
	bic = [ElementId(bic)]
	catlist = List[ElementId](bic)
	paramUtils = Autodesk.Revit.DB.ParameterFilterUtilities
	paramIds = paramUtils.GetFilterableParametersInCommon(doc,catlist)
	builtInParams = System.Enum.GetValues(BuiltInParameter)
	bipIds = []
	for bip in builtInParams:
		bipIds.append(ElementId(bip))
	bipDict = dict(zip(bipIds,builtInParams))
	bips = [bipDict.get(pId, None) for pId in paramIds]
	if bips == []:
		bips = [None]
	return bips

OUT = zip(builtInCats, map(getBips, builtInCats))