Copy Views From File

Hello all,

I am trying to create a graph that will read a list of View Names from an Excel file, select those Views from a specified Standard Details file, and copy all elements within the selected Standard Detail views into the new Revit file in the correct views. I am hoping to essentially provide the same function as Revit’s “Insert from File”.

There is one major problem that I am running into. The “Select.ByCategoryAndView” node that I am using appears to not recognize the views from the specified Standard Details file and is giving me a warning. Is there any workaround for this that anyone can think of off the top of their head? Any suggestions or criticisms are welcome!

I have attached a screenshot of my graph. (Sorry it’s so messy). Thanks for any help!

Could you check that you are not feeding view names instead of views in the Select.ByCategoryAndView node? The Object.Type node is useful for this kind of verification:
http://dictionary.dynamobim.com/#/Core/Object/Action/Type

I suppose I should check and verify. I came up with that conclusion because the graph works fine when I use it to copy drafting views within the same project.

EDIT: Just checked with Object.Type node. They are indeed views.

I would also try running your graph on each view individually to see if it’s an issue with the graph or a specific view.

Good idea. I’ll go ahead and check that.

EDIT: I checked it using just a single item and I am getting the same “viewid is not a view” error message.

I would also try with Element.GetFromLinkedFile (SteamNodes) or Collector.LinkedInstanceElements (SpringNodes) instead of Select.ByCategoryAndView since this last one is probably looking at views in the current document only…

Would those nodes work if there is no model linked in?

Probably not, but I see that Rhythm has a node called Document.CopyElementsFromDocument

1 Like

Ah, that’s probably your problem. Even though you’re using views from the other project the SelectByCategoryAndView node is selecting elements in your active document. The Rhythm node that @Yna_Db mentioned might work or you might have to try Python.

1 Like

Thanks for the suggestions!

However I have already tried the Document.CopyElementsFromDocument node from Rhythm. I had run into problems and asked @john_pierson about it a couple months ago. He replied and said that he had revised that node to only work with links, but he would try to rework it if he had the time. Unfortunately it seems he’s been busy, so I have been trying to find my own way.

Anything else you guys could think of off the top of your head? At this point, I’m wondering if I should try linking in my Standard Details files…

Element.OwnerView (Clockwork) works also on elements from linked files, if this helps…

I can give Python a shot haha. I am pretty new to Dynamo itself, let alone programming.

Sure, but it requires some basic notions, unless you want someone to do that for you, which is not the point of this forum (if I may remind that once in a while) :slight_smile:

There isn’t a lot to the copy/paste method but it might be a little tricky figuring out what you need if you’re new to python. This is the API method you’ll need. http://www.revitapidocs.com/2018/b22df8f6-3fa3-e177-ffa5-ba6c639fb3dc.htm
If you can look at any of the other copy/paste nodes that use python I’m sure that can get you 90% of the way there. The only difference here is that you’ll have to define two documents instead of one.

I highly recommend it. It can make menial little tasks so much easier even if you know just a tiny bit. And once you get the hang of it it’s pretty easy to expand and do some pretty cool things with.

2 Likes

I wasn’t trying to get you guys to do my work for me haha. Sorry if that’s how it came across

@Nick_Boyts Thanks! I guess I have some reading and research to do now.

1 Like

This whole process is a bit of a pain because you have to get views, then elements, then close the old doc. I have something, let me upload for you. (You’ll have to implement your filtering by names though.)

Description:
Obtain views from unopened file, copy views to new file, obtain stuff in views from old file, copy to new views in new file.

Animation of it in action. @hjnbyun90

And the DYN file.
transferDraftingViews.dyn (13.3 KB)

Also, apologies everyone. I have been absolutely swamped with getting ready for Autodesk University and trying to make sure I have some Rhythm updates out before. (Might add a single node for “Copy views from file”)

2 Likes

Thanks!! I was totally not expecting this. Can’t wait to try it out. Your graph is much simpler and cleaner than what I was trying too…

Although @Nick_Boyts definitely has piqued my interest a bit in Python and will probably be messing around with that now, especially since @john_pierson helped me with this issue.

Hi John,

Your script is great for drafting views. Thanks for that.

I am currently finding a solution on how to import views, sections and elevations (not drafting views) from a Revit linked file to a main Revit project.

Scenario is I got two Revit files (Link.rvt is linked to Main.rvt). Link.rvt has all the views created and I want to copy it to Main.rvt. I got a script initially created using the Rhythm package. I was able to extract the views from Link.rvt but I haven’t been successful in pasting or creating the views to Main.rvt. Have you come across such scenario before? Thanks!

Image

1 Like

Hi @rivasj,

This has come up a few times before, but I do not think anyone has found a solution yet. The part with sections and elevations is, they require the marker to come through.

Additionally, the copy elements between files workflows are fairly unstable.

You might be able to do the following:

  1. Get the views from link document

  2. Obtain the plan symbol for the views. (Elevation marker, section marker)

  3. Get the location of the plan symbol

  4. Create a new plan symbol in your host document.

I don’t have anything showing this at this time though. You might want to give it a try and start a new topic.

Also, reference this post for some additonal ideas.

-john