This functionality has been requested a few times on Dynamo blog, so I thought I will make it official and share it here for everyone. This adds a few nodes to Archi-lab package that will allow you to import an image or simply reload it from a given path. Here are the steps and code for reference:
- Let’s get a View that we will be importing our image into:
I am using a Get All Views node here that comes from Archi-lab_Grimshaw package.
- Next step is to create import options for our view. Import options allow us to control things like a placement point and image resolution:
Box Placement Types node can also be found in Archi-lab_Grimshaw. It’s just a simple dropdown that allows you to position the image in relation to reference point. Here’s code for Image Import Options node:
- Next up we just need to put all these together like so:
Keep in mind that if we re-run the definition it will keep placing images in the specified location. If your intention is to reload it, you can do this: This node checks if a given image exists in the model and reloads it. Here’s code for both of the nodes:
This is it! Pretty quick and easy way to manage our imported images.