No joke, this post is going to deal a bit with coding, even if I’m currently not a coder at all.
The story began with a question from a colleague: how can I get elements from a linked file and have them in my host project?
My first idea was to copy paste things, but things are going to update, so no way. Then the hack of using MEP categories, and copy monitor them. Hack only, I was looking for a more robust solution as the linked models are not always in-house models. So I started gathering thoughts about doing this with Dynamo…and followed this idea.
The final result is not essential, as I learned SO MUCH in doing this. Really.
Find a problem, solve it with Dynamo: best training ever.
In the video and pictures bellow, I will try to explain what I’m doing here.
The definition is available in a link at the bottom, and I have uploaded Dynamo packages for the custom nodes.
I hope you find at least interesting if not useful.
## DISCLAIMER: this is a Work In Progress, use at your own risk, and always remember I’m not a coder ##
The first custom node deals with collecting linked projects. The tricky parts is that a link exists in the database as a Revit document, but also as Instances. I have had to deal with that in the Python part. Custom node is pretty simple:
It provides 3 lists: the linked documents (one per linked file), the names of the documents (to choose from), and the instances of links (one or more per link document).
The Python code goes like this:
I’m still learning, so I don’t want to digress on this code here. See you on the Vasari forum if needed.
The next step is to collect family instances in the linked documents.
This custom nodes allows you to choose for a document (index in the documents list), a category, and gives you the family instances for each instance of links, with the tranform for each, meaning you get the offset to apply to families so that they are at the correct place, no matter where the link instances are in the host. Move them, it updates. See video.
Custom node naked:
and the Python code:
and the final part, straightforward in Dynamo: create family instances from XYZs.
As promised, the definition file is available here, Beware of downloading the packages Get linked documents and Get family instances from Revit link to make it run properly.
I would really like having your thoughts and comments.