Batch process export from Revit to Navisworks

Batch process export from Revit to Navisworks

madhusudhana_rao
Contributor Contributor
4,820 Views
6 Replies
Message 1 of 7

Batch process export from Revit to Navisworks

madhusudhana_rao
Contributor
Contributor

Hi All,

 

I am having a 4-5 revit models, at frequently I need to exported 3d views in Navisworks for clash checks.

 

Is there any batch process for export my Revit 3D views of each model into Navisworks as (.nwc)

 

It would be useful if anybody has any macro. Appreciated

 

Thanks

Madhu

 

 

0 Likes
4,821 Views
6 Replies
Replies (6)
Message 2 of 7

Mustafa.Salaheldin
Collaborator
Collaborator

Try to use "Batch Utility" from Navisworks and set the export settings to the 3D views you want.

 

See the following list: To Generate a List of All Design Files Used in the Current Model


¯\_(ツ)_/¯
Let it work like a charm.

Mustafa Salaheldin


EESignature




Digital Integration Manager, DuPod

Facebook | Twitter | LinkedIn

0 Likes
Message 3 of 7

madhusudhana_rao
Contributor
Contributor

Thanks for your prompt response.

 

Would Navisworks Batch utility do perform like the below items ?

 

a) Automatically open my Archi / Stru / M&E central models from Revit....

b) Would Go to the 3D view as specified.....

c) Export the 3d View in shared co-ordinate system....

d) save at desired folder as (.nwc)

 

If this works.... my issue absolutely solved.....

 

Thanks once again

Madhu

 

 

 

 

0 Likes
Message 4 of 7

Mustafa.Salaheldin
Collaborator
Collaborator

Yes you can import all the trades models in one NWF file and adjust the NWC export settings to export the 3D view in each file.


¯\_(ツ)_/¯
Let it work like a charm.

Mustafa Salaheldin


EESignature




Digital Integration Manager, DuPod

Facebook | Twitter | LinkedIn

0 Likes
Message 5 of 7

JimJia
Alumni
Alumni

Hi,

Revit provides Navisworks export API which can achieve your request:

. Iterate all Revit model and open it with API: Autodesk.Revit.ApplicationServices.OpenDocument(string)

. Create export option of NavisworksExportOptions

. Call Document.Export(string folder, string name, NavisworksExportOptions options);


Jim Jia
Autodesk Forge Evangelist
https://forge.autodesk.com
Developer Technical Services
Autodesk Developer Network
Email: Jim.Jia@autodesk.com
0 Likes
Message 6 of 7

madhusudhana_rao
Contributor
Contributor

I guess your response is suitable for my question...

 

Could you please write a small API programming code to the automation process.

 

Thanks

Madhu

0 Likes
Message 7 of 7

JimJia
Alumni
Alumni

Here is code example you can refine and run, FYI:

 

 public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
Application revitApp = commandData.Application.Application;
string [] files = Directory.GetFiles(@"<your folder contains rvt files>", "*.rvt", SearchOption.TopDirectoryOnly);
foreach (var file in files)
{
// open each rvt
Document rvtDoc = revitApp.OpenDocumentFile(file);
//
// find one 3d view
FilteredElementCollector coll = new FilteredElementCollector(rvtDoc);
View3D v3d = coll.OfClass(typeof(View3D)).ToElements().Cast<View3D>().Where(v => !v.IsTemplate).First();
//
// create export options, you may need to specify more options
NavisworksExportOptions opt = new NavisworksExportOptions();
opt.ExportScope = NavisworksExportScope.View;
opt.ViewId = v3d.Id;
//
// export the 3d view model to nwc
rvtDoc.Export(@"<your export folder>", rvtDoc.Title + ".nwc", opt);
rvtDoc.Close(false);
}
return Result.Succeeded;


Jim Jia
Autodesk Forge Evangelist
https://forge.autodesk.com
Developer Technical Services
Autodesk Developer Network
Email: Jim.Jia@autodesk.com