Hello everyone!
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
Thanks!
Kulkul
February 20, 2020, 5:11pm
2
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?
Kulkul
February 20, 2020, 5:25pm
6
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))