Retrieve and delete parameters from elements in the document - that are not active in the model

Hello

Sometimes I have had the following challenge, when working in Revit.
It is not a problem as such, but rather irretating, when you work with many elements in the model.
This is an example of what happens:

  1. I place 4 doortypes in my model and give them all a Type Mark: D1, D2, D3 and D4.
  2. In a following revision I delete the door With Type mark: D3, and now it is no longer in the model - although still in the document.
  3. Later i want to place a new door into the model and for specific reasons I would like its Type Mark to be D3.
    However if I just name the Type Mark in the new door D3, I will get a warning saying: "Elements have duplicate “Type Mark” values.
  4. I am now missing an efficient method for “cleaning” Type marks from the non active doors in the document, so I can apply them to other doors.

I have tried to fiddle around with a way to retrieve ALL the doors in the document (not just the ones showing in the model!) and also get a list displaying their Type Mark with the aim to remove them the doors not used in the model.
However, I can’t find any command in Dynamo which gives me what I want, and I haven’t found anything similar in the forum either, so I hope someone in here can help me out

(I know it’s fully possible to retrive these elements and parameters from Objects if they are placed in the model, but i cannot figure out what is possible with elments or values which are not “active” in the document…)

Hope someone has a tip…

Cheers
Erik

Hi,

The Revit error only shows up if you use the Type Mark parameter, so why don’t you use a new Shared Parameter set up as Project Parameter set to the Doors Catagory. Duplicate “Type Marks” won’t bother anymore and you can maintain consistancy as if it was the Type Mark parameter in the same way you do it now

Hi @ELT-78,

You can get all types and instances by inserting the code below into a python node:

import clr

#Import the Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *

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

#Reference the active Document and application
doc = DocumentManager.Instance.CurrentDBDocument

doors = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Doors).ToElements()

OUT = doors