I’m looking for some help developing a script to import pages of pdfs onto sheets. The max will be 8 per sheet, so I’d have to ensure you can input a page range each time it’s run (1-8, etc.)
I’ve found this for importing images onto a sheet, but only in a column.
But I will need the script to make two rows so it’s 2x4 pdf pages on a sheet like this:
The script I currently use just imports pages, and still requires manual placement:
If you use the column graph, but set the X value to have a similar range and utilize cross product lacing on the point creation you should be all set.
How would I go about setting it up to create the 2 rows of 4 as well? Would I have to split the script into 1-4 and 5-8 or could it be done all at once?
Look into the list lacing demo of the Dynamo primer, as this includes a demo showing cross product lacing to build rows and columns.
I am doing a similar thing, but I want each instance of the PDF to be a different page. When I do the cross product lacing, I get a grid, but the PDF page is repeated ten times up and over. Is there a way to make it so that a 10 page PDF gets laid out in two rows of five for example?
Likely, yes. Would need you to post your work so far as well as a dataset for such.
That’s a classic Dynamo hurdle. Usually, the easiest way to handle this is to first convert the PDF pages into image files (like PNG or JPEG) and then use the ‘Image.Import’ and ‘Element.SetImporter’ nodes to place them on sheets. Since Revit doesn’t natively treat a multi-page PDF as a single ‘placer’ object, you’ll save yourself a lot of headache by splitting the PDF into individual pages first. I’ve used Split PDF by Page Range Online for this before when I didn’t want to mess around with Acrobat - it’s quick and keeps the resolution clean for the import. Once you have the individual files, you can just use a Directory Path node in Dynamo to bulk-import them onto your sheets.