Insert image on sheet in batch depending of sheet name/image name

I’m looking to have different image (QR Code) on sheet of assembly (pipe spool for fabrication). I have a script to create a QR Code according to each assembly name in my revit project. I would like to be able to apply these QR Code on every sheet in a batch. Currently I’m using script published by Konrad K Sobon (Import Image Option and Image Import) and i’m able to do it on a single sheet at a time (I must input the file path and the sheet manually) I would like to be able to do it for every assembly sheet at one time. The QR Code image would have the same name as the sheet name but I can’t find a way to do it. (see below the dynamo i’m using now) Anyone have any hint of what I could do to achieve it? Thanks a lot

  • You can start by collecting all the sheets:
    Categories (sheets) → all elements of category
  • extract the name: element.name
  • concatenate a string to make the path to the file from Directorypath + \extracted name+.jpg

you might need to create a custom node and set its lacing to longest or use function or map node to get your script to process the whole list as the python code is not necessarly structured to handle and match multiple inputs

I’m able to get the list of all the sheets name, also i’m able to get the list of all .jpg in the folder where my QR Code are but since the python code of Image Import is made for single input only (I guess) I don’t know how to do it properly.
I’m kinda new to Dynamo so I don’t know if the path I choose is the best one. I have found an add-in to create a QR Code and put it in the Image parameter of the assembly, I can then schedule it and put it on my sheet but it’s a manual process and for multiple spool it’s not viable. I’m not sure if Dynamo or Scheduling is the best way.

by creating a custom node from your python script (right click on it and create the custom node) you will be able to play with the lacing and get it to process your lists
image

for more info
https://primer.dynamobim.org/10_Custom-Nodes/10-1_Introduction.html

I used similar workflow using this node from GIS2BIM package. This node accepts multiple sheets and multiple images as input. Play with x and y values to match your sheet location

thanks for the hints. I have look at the coding in this script and have modified my custom node/script and I’m one step closer to the result I’m looking for. My problem now is that my script want a View to apply the image on but I have a string. See image below.

Can I convert string to “view” in any way?

Here is my MultipleImageImport custom node:

Thanks

image
Try get view by name from GeniusLoci package.

1 Like