How to access NavisworksExportOptions

How to access NavisworksExportOptions

Anonymous
Not applicable
2,180 Views
18 Replies
Message 1 of 19

How to access NavisworksExportOptions

Anonymous
Not applicable

Hi all, 

 

I'm writing a Revit plugin to export NWC files. Before exporting I need to access NavisworksExportOptions to get the current option in Revit. How can I do that ?

 

Thanks,

Cuong

0 Likes
Accepted solutions (1)
2,181 Views
18 Replies
Replies (18)
Message 2 of 19

jeremy_tammik
Alumni
Alumni

Create a new instance using the constructor:

 

https://www.revitapidocs.com/2021.1/49a74067-e7da-903b-83ea-fe51274cbd32.htm

  

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

Anonymous
Not applicable

Hi Jeremy,

 

I mean I'm developing a custom Navisworks Settings screen, basically it's the same with the Navisworks Options Editor when user want to export NWC file. I want to take the current Navisworks Options set by user and this options will be populated in my custom setting screen

 

revit_settings.png   This is Navisworks Options Editor

 

custom_settings.png  This is my custom settings, I want to take the settings from above screen and show in my screen when I run my own Revit plugin.

 

Any idea is appreciated

  

0 Likes
Message 4 of 19

jeremy_tammik
Alumni
Alumni

I am not aware of whether these settings are stored anywhere. What does the Export button do?

 

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

Anonymous
Not applicable

Hi Jeremy,

 

Below the function Export NWC

 

cuong_zyca_0-1622539893851.png

 

 

2021-06-01_16-26-04.png

 

revit_settings.png 

I don't know where these values are stored so I'm unable to retrieve them.

0 Likes
Message 6 of 19

jeremy_tammik
Alumni
Alumni

I asked the development team for you.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 7 of 19

Anonymous
Not applicable

Thanks Jeremy

0 Likes
Message 8 of 19

RPTHOMAS108
Mentor
Mentor
Accepted solution

That interface is not inherent to Revit, comes with Navisworks install or exporter. 

 

For the 2021 version there is a settings text file named:

 

C:\ProgramData\Autodesk\Revit\Addins\2021\revit_exporter2021.Addin.bundle\nwexportrevit2021\nwcreate_data18\nwexportrevit.cfg.

 

If there is no better way you'd have to see if you are able to decode the content of this so you can parse it.

 

I spent a lot of time replicating UI settings for Navis and other forms of export. I would rather have just said 'use this named configuration'. For IFC you can do this since it has named configurations i.e. leave the settings UI to what people are familiar with and just pick the saved configuration in your interface.

 

 

Message 9 of 19

Anonymous
Not applicable
Thank you for the clarification
0 Likes
Message 10 of 19

RPTHOMAS108
Mentor
Mentor

If you are reading that file make sure the path is found relative from:

 

Autodesk.Revit.ApplicationServices.Application.AllUsersAddinsLocation

 

and not hardcoded.

Message 11 of 19

Anonymous
Not applicable

Thank you

0 Likes
Message 12 of 19

jaymee.manglicmot
Contributor
Contributor

Hello @Anonymous @RPTHOMAS108 , are you able to get the current settings of the users from the cfg file (C:\ProgramData\Autodesk\Revit\Addins\2021\revit_exporter2021.Addin.bundle\nwexportrevit2021\nwcreate_data18\nwexportrevit.cfg) When I try to update the Navisworks settings in Revit, the config file is not being updated. Are there other config files where Revit is looking or do I need to do/configure something else. I am also building a tool which aims to export to NWC and get the current user settings first before exporting. Thank you.

0 Likes
Message 13 of 19

RPTHOMAS108
Mentor
Mentor

No actually more likely to be in registry settings such as:

Computer\HKEY_CURRENT_USER\SOFTWARE\Autodesk\Navisworks Exporters x64\18.0\GlobalOptions\file_readers\nwexportrevit

 

Perhaps noted file is for initial values etc.

 

Message 14 of 19

Anonymous
Not applicable

This cfg file is only for the initial values. I create a xml file to store the current setting.

Message 15 of 19

jaymee.manglicmot
Contributor
Contributor
Thanks for the quick response. Is there an API to do the export of settings from the Navisworks Options Editor in Revit?
0 Likes
Message 16 of 19

Anonymous
Not applicable
0 Likes
Message 17 of 19

jaymee.manglicmot
Contributor
Contributor

I mean this one, wanted to also export the settings into xml first and then get the current user settings before exporting to nwc.

jaymeemanglicmot_0-1627352358115.png

 

0 Likes
Message 18 of 19

Anonymous
Not applicable

I use XmlDocument for parsing / writing setting.xml file (the file I use to store the current optiopns)

 

0 Likes
Message 19 of 19

jaymee.manglicmot
Contributor
Contributor

Thanks @Anonymous , I mean how do you get the current options/settings? How do you generate the "setting.xml" file? I can't seem to find a way via the API to get what the user has checked or not checked in the Navisworks Options Editor.

0 Likes