Need Help! Export DWG from Revit API

Need Help! Export DWG from Revit API

ckcmike
Participant Participant
1,951 Views
1 Reply
Message 1 of 2

Need Help! Export DWG from Revit API

ckcmike
Participant
Participant

I have challenges need help. I am writing an API for Export DWG files from Revit , need each view on sheet view be exported individaully but merged with views from Linked Models.  

As my understanding, Revit export DWG can be either merged views or not merged views. If I choose merge views, the views on sheet view will be exported as one DWG file, on the other hand, I choose not merge views, all the views include Linked Model view and sheet view will be exported individually. But I need the views bind with the Linked Model views while export DWG and seperated from the sheet view.

My initial thought is create a export loop which get SheetView be exported as non-merged views then collect all the Views on the SheetView and export then as merged views. 

 

Firstly, I don't know how to collect Views from a SheetView. Is it a way to accomplish such collection?

Secondly, does my initial though about the export process work?

 

Please help and free to comment.

0 Likes
1,952 Views
1 Reply
Reply (1)
Message 2 of 2

jeremytammik
Autodesk
Autodesk

Dear ckcmike,

 

Before you begin coding, ensure that you have the exact detailed steps laid out and working manually from the user interface. The Revit API will mostly not enable you to achieve anything that cannot be done manually as well. If you can achieve the merging you desire manually, chances are it can be automated also.

 

Regarding your other question, it looks as though this really old post on the Revit 2009 API already enables what you wish:

 

http://thebuildingcoder.typepad.com/blog/2009/01/viewports-and-sheets.html

 

A more up-to-date version of the CmdListViews command mentioned there is available from the most recent download of The Building Coder samples:

 

http://thebuildingcoder.typepad.com/blog/2013/09/room-neighbours.html

 

Actually, almost all conceivable questions on the view API are answered by Steve Mycynek's AU class on the topic:

 

http://thebuildingcoder.typepad.com/blog/2012/11/au-classes-on-the-view-mep-and-link-apis.html

 

I hope this helps.

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder