Copying schedules between documents (similar to Rhythm Documents.CopyElementsFromDocument)

I am very new to Dynamo (I have lots of Grasshopper experience), so not sure if this is possible or not, but I feel like I’m close. I want to create a simple application that copies all schedules from a user-selected load file into the active project. I’ve recently created some schedules that have various code analysis functions within them, and I would like the user to be able to quickly chose what version of IBC code they are using for their project and import all schedules from that particular load file.

As of right now I’m running into two issues.

The first thing (potentially very minor) is that my Data Shapes UI only works the first time I run the graph. When running the graph a second time, the UI will not pop up. To get the UI to appear again, I have to set the toggle to “False,” run the graph again, then set the toggle back to “True” and run once more. This might be caused by the unresolved errors in my second issue, so I’m not too worried about this one yet.

The second and main issue arises when trying to copy the schedules between documents. I tried the Rhythm approach outlined in this article. It seems like most of it worked (document opened correctly in background and schedule views were collected), but Rhythm’s Documents.CopyElementsFromDocument doesn’t seem to like copying schedules. Below is a screenshot of this portion of my graph. (input on left is just a filepath from the Data Shapes UI output)

Does anyone know of an approach that might work? I know that it would probably be much simpler just to direct people to Insert > Insert from File > Insert Views from File then select the load file and select all of the schedules they need, but that’s a lot of steps. I was hoping a Dynamo application could be a bit cleaner and more foolproof. Thanks in advance!


Here’s the UI portion of the code, in case I’m doing anything wrong here.

Hello @SURFACEFUSION and welcome to the forum…it should work on schedule, try as here


Revit_pZ1ZIDooCd

1 Like

Thanks for the reply. I updated my “collects drafting views from chosen document” section to match how you’re filtering down to schedule views, but I’m still getting the same error on the Documents.CopyElementsFromDocument block as before. Here’s what error I’m getting:

image

1 Like

Great…how do you collect the link ? we will need to see all whats goin on

My example is for schedules, but you can do it with DV as well :wink:

After looking a bit closer, I had some ghost ScheduleViews appearing in my collection that do not appear in the project browser. (You can actually see them in my screenshots, specifically the ones that say “Interiors…” and “Revision Schedule”) Once I filtered these out, it now seems to work as intended.

For anyone curious the schedule sorting method that seemed simplest to me involved placing all the schedules I actually wanted onto a sheet within my load file, then only selecting the schedules that are placed on this sheet. See screenshot

Just curious, have you tried using Dynamo to just create the schedules as needed instead of copying ones from an existing project? You can apply all of the same filtering, sorting/grouping and formatting using Dynamo. There are however a couple of the appearance options that are not available, but those can be resolved with using view templates.

Just in case you didn’t know, you can also copy schedules from one project and paste them into another using the clipboard. However, you have to have both projects open in the same session of Revit.

The issue with Data-Shapes is when you run the script directly in Dynamo, it retains the user input information and doesn’t refresh when running sequentially. When using that package in scripts, it’s best to set the script up to run in Player where it resets the script every time.

1 Like

Creating the schedules in Dynamo isn’t a bad idea, I just don’t have much experience doing that yet.

For more background on this, I just recently created a load file based on IBC 2015 with 4 key schedules and 8 building component (room) schedules that each contain certain calculated parameters in order to automate certain aspects of the code review process. I then copied the file and updated the information in the second file to IBC 2018, and plan to make more with IBC 2021, 2024 and so on into the future. My Dynamo script now allows the user to simply select an IBC version, and Revit can then do all of the work loading in all of the correct schedules from the correct load file for the selected code version.

Some future additions I might make to this script could include a UI that prompts the user to input some of the parameter values (construction type, building classification, etc.), plus automatically laying out all of the schedules on the code plan. I messed around with both of these for a bit, but I couldn’t figure out how to simply accomplish either function.

As for Data-Shapes, I was starting to understand that this might be the case. I’m planning to have people use this in player anyways, so it should work fine.

1 Like