Hello,
I have a question about using the InterferenceCheck.Parse node with linked files.
I have a Structure file, linking a MEP file.
My Interference file is created from the structure file.
How do I retrieve items from the linked file?
Maybe with the Id to Element node (DOC), but I can not find it.
Note: I applied directly to Dimitar
As per my email:
Hi Alain,
Here’s my suggestion:
- You’ll first need to get the linked document that the MEP elements reside in. I suggest either clockwork or archi-lab’s node for that:
- Secondly, you’ll need to slightly modify clockwork’s “Element.ByID” node like so:
and the script inside it:
Hello,
Thank you for your quick reply.
To start, my Clockwork node (version 1.0.2) is different from yours.
Here is the node:
I modified the script “UniqueIDs” and “IDs”
I only get the first item on the list
Hi,
New attempt.
I have problem with the Clockwork node (unable to load them)
I then attempted to duplicate the Element.ByID node. But can you tell me if this is correct, because the result is not good.
Code:
Element.ByID:
ReturnListOrSingleValue:
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
Hi,
Thank you again for your time.
it works well !
Note: I always have a problem with Dynamo (1.2.1.3083) which does not show your new node, nor the node ReturnListOrSingleValue.
So I put the 2 nodes in Dynamo Revit \ 1.2 \ definitions.
Open each node, and save them with a new name (_New at the end of the name)
Then it is possible to add your node.