InterferenceCheck.Parse : Recover the elements of the linked file?

Hi @Alain_Hamel,

My bad, I forgot that we’re passing around strings and not ElementIDs. Therefore our first task will be to get valid ElementIDs. I’ve attached below a modified version of the node:

Element.ByID.dyf (6.4 KB)

and here’s the code:

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

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager

doc = UnwrapElement(IN[1])
items = UnwrapElement(IN[0])

if doc is None:
    doc = DocumentManager.Instance.CurrentDBDocument

elementlist = list()
unmatched = list()
for item in items:
    try: 
        if isinstance(item, int):
            item = ElementId(item)
        elif isinstance(item, str) and len(item) < 12:
            item = ElementId(int(item) )
        elementlist.append(doc.GetElement(item).ToDSType(True) )
    except:
        unmatched.append(item)
OUT = (elementlist, unmatched)

and the new node in action:

1 Like