Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Copy Views from Revit Linked File into Host File

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
jazlik
515 Views, 7 Replies

Copy Views from Revit Linked File into Host File

jazlik
Contributor
Contributor

Hey!

 

Did anybody try to create a tool which can copy a few views from the Revit Linked model and create them(with the same parameters etc.) in the host model? I am trying to do so but I am stuck at the moment when I have to "copy" views from Revit Link Model to Host Model. Did anybody try it and it is feasible? Or maybe you got some tips about this topic.

Thanks!

0 Likes

Copy Views from Revit Linked File into Host File

Hey!

 

Did anybody try to create a tool which can copy a few views from the Revit Linked model and create them(with the same parameters etc.) in the host model? I am trying to do so but I am stuck at the moment when I have to "copy" views from Revit Link Model to Host Model. Did anybody try it and it is feasible? Or maybe you got some tips about this topic.

Thanks!

7 REPLIES 7
Message 2 of 8
sahin.ikbal
in reply to: jazlik

sahin.ikbal
Advocate
Advocate

Use ElementTransformUtils.CopyElements(),
And copy the view elements from the Link document.

 

 

0 Likes

Use ElementTransformUtils.CopyElements(),
And copy the view elements from the Link document.

 

 

Message 3 of 8
jeremy_tammik
in reply to: jazlik

jeremy_tammik
Autodesk
Autodesk
Accepted solution

Take a look at the Revit SDK samples, especially DuplicateViews:

  

Subject: Copy paste drafting views and schedules from one document to another.
Summary: Use the copy paste APIs to copy drafting views and schedules from one document to another.  The drafting view contents will also be copied.  

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes

Take a look at the Revit SDK samples, especially DuplicateViews:

  

Subject: Copy paste drafting views and schedules from one document to another.
Summary: Use the copy paste APIs to copy drafting views and schedules from one document to another.  The drafting view contents will also be copied.  

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 4 of 8
jazlik
in reply to: jazlik

jazlik
Contributor
Contributor

Hey! Thanks everyone for answering my question. I assume it is doable then 😄 I will look into these materials and maybe post my progress when I am done!

Thanks!

0 Likes

Hey! Thanks everyone for answering my question. I assume it is doable then 😄 I will look into these materials and maybe post my progress when I am done!

Thanks!

Message 5 of 8
jeremy_tammik
in reply to: jazlik

jeremy_tammik
Autodesk
Autodesk

Great. Yes, please do. Thank you.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes

Great. Yes, please do. Thank you.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 6 of 8
jazlik
in reply to: jazlik

jazlik
Contributor
Contributor

Hey! I would say long time no see! I just came back to this problem few days ago.

And so far it works ok 🙂

First I must say thank you @jeremy_tammik for your sample codes! These are great and I used some of them in my code(this is also a question, can I use them?)

 

Just a quick introduction how code is working:

 

jazlik_1-1674725755154.png

 

Basically I can pick a few views from revit links and copy them to the host revit link. On the picture you can see I selected 3 of them and just 3 were copied.

 

However, sometimes when I am copying lost of views, I got a following error:

jazlik_3-1674726130277.png

 

I guess that there is just a problem with some view or views that I cannot copy and it is more like a Revit error. Can anybody give me some guidance why Revit is not able to copy some views and some it can copy?

 

0 Likes

Hey! I would say long time no see! I just came back to this problem few days ago.

And so far it works ok 🙂

First I must say thank you @jeremy_tammik for your sample codes! These are great and I used some of them in my code(this is also a question, can I use them?)

 

Just a quick introduction how code is working:

 

jazlik_1-1674725755154.png

 

Basically I can pick a few views from revit links and copy them to the host revit link. On the picture you can see I selected 3 of them and just 3 were copied.

 

However, sometimes when I am copying lost of views, I got a following error:

jazlik_3-1674726130277.png

 

I guess that there is just a problem with some view or views that I cannot copy and it is more like a Revit error. Can anybody give me some guidance why Revit is not able to copy some views and some it can copy?

 

Message 7 of 8
jeremy_tammik
in reply to: jazlik

jeremy_tammik
Autodesk
Autodesk

> Can I use the code? 

  

Yes, sure, that is what it is out there for. It loves being copied, that is its one and only purpose in life. Thank you for your appreciation!

  

> Can some views not be copied?

  

Yes, I think that template views, can cause problems, for instance. Maybe some others also rely on specific document-specific elements or something.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open

> Can I use the code? 

  

Yes, sure, that is what it is out there for. It loves being copied, that is its one and only purpose in life. Thank you for your appreciation!

  

> Can some views not be copied?

  

Yes, I think that template views, can cause problems, for instance. Maybe some others also rely on specific document-specific elements or something.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 8 of 8
jazlik
in reply to: jeremy_tammik

jazlik
Contributor
Contributor

So the best idea would be to search which views are causing the problem and filter them beforehand so they do not appear on the list. Thanks! Will try to do that.

So the best idea would be to search which views are causing the problem and filter them beforehand so they do not appear on the list. Thanks! Will try to do that.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report