In an empty Model, how to list "BuiltIn parameters" of all "BuiltIn categories" of revit

Hi all,

In an empty model (revit file, without nothing drawn), we know how to extract lists of “BuiltIn Categories” and “Builtin Parameters” separately, using the clockwork nodes.

But in an empty model, how to list all “BuiltIn parameters” of every “BuiltIn category”?

We know how to do it in a model with elements drawed (walls, columns, etc…), and we can extrat a list from those elements, listing his parameters and categories.

But we need to do it in an empty model (revit file, without nothing drawn), and we need to list all revit “Builtin parameters” of every “Builtin Categories”, without to need to draw an element of every category.

Is it possible?

Best regards,
Xavier

So what you’re in fact after is the parameters of each category in a list?

As the “BuiltInParameters” you are pulling is all the available parameters in the document?

It might be something like this you’re after:

1 Like

Hi Jonathan,

First of all, thanks for your answer. I just test your dynamo, it’s interesting… but it doesn’t works in an empty model (a revit file, without nothing drawn: no walls, no columns, nothing).

The ouput list from “Document.ProjectParameterByCategory” is empty:

As far as we know, the “Document.BuiltInParameters” node of clockwork, lists the default parameters of the revit api, regardless of whether there is something drawn or not drawn, in the rvt file.

Hi

This might be of use

3 Likes

Hi m.rijsmus,

Thanks for your answer. We know this list, it’s very interesting. But some of his sheets have incomplete lists, and it’s not useful for us. We need to query those lists, from revit api directly…

Thanks and best regards,
Xavier

@EiPM_Xavier If I’m understanding correctly you are looking to get the BuiltInParameters for each BuiltInCategory on an empty model… I believe the GetFilterableParametersInCommon() method does the trick. I took a swing at a Python script and it likely has a lot of room for improvement but it appears to be providing the list you are seeking:

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))

Here is the output Excel file, but it could use some formatting help since the lists are rather large: BuiltInCategoryBIPs.xlsx (77.9 KB)

I believe this script would fail on a model that has additional project parameters (they will just return null because of how it is written). It would need to be adjusted to return the project parameters by their IDs, right now it will only find BuiltInParameters by their IDs.

Hope this helps!

7 Likes

In addition to Amy’s great script I’ll just add links to the Revit API guides actually listing the BuiltInCategories and Parameters.

Categories:
http://www.revitapidocs.com/2018.1/ba1c5b30-242f-5fdc-8ea9-ec3b61e6e722.htm
Parameters:
http://www.revitapidocs.com/2018.1/fb011c91-be7e-f737-28c7-3f1e1917a0e0.htm

Pulling only these using Python would look something like this:

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)
builtInParams = System.Enum.GetValues(BuiltInParameter)
OUT = builtInCats,builtInParams
4 Likes

Superb!
Thanks a lot Amy and Jonathan for yours answers!

I will test it.
Best regards,
Xavier

@EiPM_Xavier See if this OOTB approach works for you…


parameterNames.dyn (15.8 KB)

3 Likes

Very interesting approach Vikram, It’s good a script, thanks!
Although in “code block” shows a warning, the dyn file works (I run this dyn in an empty revit file)

I show this warning:

Best Regards,
Xavier

1 Like

hello @Vikram_Subbaiah how to know if the built-in parameters of a list are Type parameters, Instance Parameters, Family Parameters, Global Parameters, Shared Parameters

I really appreciate if the script can give output of a list of builtin parameters as same names that you could read in Revit properties of elements, as this does with LabelUtils.GetLabelFor(bip)

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

bips = System.Enum.GetValues(BuiltInParameter)
pdata = list()
for bip in bips:
	try:
		pdata.append((bip,ElementId(bip),LabelUtils.GetLabelFor(bip)))
	except:
		pass
OUT = pdata