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: 

Automate exporting NWC files?

8 REPLIES 8
Reply
Message 1 of 9
corey_schiller
3070 Views, 8 Replies

Automate exporting NWC files?

As my first forray into the Revit API, I want to be able to automate the process of saving out NWC files from various views in a project.  If possible I'd like to script this, so that it can be done on a schedule, say daily at a certain time.

 

Is this possible without too much time and effort?

What would be the best approach to tackle something like this?

Where can I find sample code to get me going?

 

Thank you!

8 REPLIES 8
Message 2 of 9
m.p.diker
in reply to: corey_schiller

Yes that can be done. I've seen a class in AU about it.

 

It's a little bit messy as it involves using journal files and windows task scheduling. If I can find the link (when at home) I'll pass it to you!

Message 3 of 9

Yes, if you can find that info it would be much appreciated!

Message 4 of 9
m.p.diker
in reply to: corey_schiller

Here you go..

 

http://au.autodesk.com/?nd=class&session_id=9039

 

CR3220 Automating Autodesk® Navisworks® Clash Reports

Message 5 of 9
bthatcher
in reply to: m.p.diker

Messy isn't the word for it. If I remember correctly they were using DWF files because of a dialog that kept coming up. And their report may have been a text file or something, no images in any case.

Message 6 of 9

Thanks for the reply, unfortunately I don't have an AU subscription..

Message 7 of 9

Hi Corey,

 

Anybody can sign up for the AU site to access to the class materials from the AU in the past.  Feel free to register for it.

 

As to the original question about API for exporting NWC, that feature is an addin coming from Navisworks product.  No API within the Revit for that. We have a wish to make it accessible through API, however. 

Technically speaking, it is possible to write your own using Revit API and Navisworks NWcreate API. But it will involve quite a lot of coding, I'm sure.

 


Mikako Harada
Developer Technical Services
Message 8 of 9
psmith
in reply to: mikako_harada

For those that arrive here from a search engine (like myself) check out the new INavisworkExporter interface: http://www.revitapidocs.com/2017/b389017c-d7af-f0a4-7440-e9dc30f47718.htm

Message 9 of 9
thomas
in reply to: corey_schiller

This is very easy to do using the class:

 

 

NavisworksExportOptions 

 

 

Note that you need to install the free Navisworks exporter utility  here, otherwise the 

Document.Export

method you need to save the NWC will throw an exception. You can also implement a check in case your users don't have the NWC exporter utility installed: 

 

OptionalFunctionalityUtils.IsNavisworksExporterAvailable()

 

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community