To step into this topic, it is recommended you take a look at the previous blog that introduces Navisworks ActiveX Controls.
1. Write the code of web page
(1) To use the control with web, the web application (such as HTML) is similar to any other kind of ActiveX control. The core code is
<OBJECT ID="NWControl01" CLASSID="CLSID:xxxxxxxxxx"
CODEBASE="..\..\bin\Navisworks ActiveX Redistributable Setup.exe">
<PARAM NAME="_cx" VALUE="14000">
<PARAM NAME="_cy" VALUE="12000">
<PARAM NAME="SRC" VALUE="..\gatehouse.nwd">
- xxxxxxxx is the GUID mentioned in the post .
- CODEBASE is the installer for Lite, Full or Redistributable control.
- _cx, _cy, SRC are some properties of the control. SRC can also be specified dynamically. To know all properties please refer to \ <Navisworks Install Path> \api\COM \documentation\NavisworksCOM.chm
- SRC can be absolute, UNC or relative path.
(2) Every type of control can be used with the web page. You need to specify the correct GUID.
(3) For Built-in or Integrated control, CODEBASE is useless because the client should have installed Navisworks.
(4) Before 2013, the <Navisworks Intallation Path>\api\COM\example\ACTX_01 is a good sample to get started with.
2. Setup the web server
In this blog, we take IIS as an example. It is very straightforward to setup the server like what you do normally.
(1) put the model file in some location on your server. make sure the relative
path is correct
(2) put the HTML in the site that the client user can access
(3) With Lite, Full or Redistributable control, make sure the installer is available
on the server and make sure either 32bits or 64bits you want to provide.
Redistributable : Navisworks ActiveX Redistributable Setup.exe
(4) Remember to add MIME type for nwd file. The format is:
3. Client End
(1) If the web page uses Built-in or Integrated control, make sure the client
machine has installed Navisworks (Simulate/Manage)
(2) Currently only IE can open the page with Navisworks control
(3) If the web page uses 32bits control, you must open the web page in
IE-32bits. If the web page uses 64bits control, you must open the web
page in IE-64bits. This happens particularly when the client is 64bits OS.
So, with Lite, Full or Redistributable control, this depends on which installer
the server provides.When you open the page in the first time, a warning
message will ask if installing the ActiveX control.
With Built-in or Integrated control, since they have only 32bits on 32bits OS,
64bits on 64bits OS, you can only open the page with corresponding IE.
No warning message for installing.
The screenshot below is a sample when I deploy the SDK sample ACTX_01 to my server.
4. Trouble shooting
- 64bits OS: On 64bits, Integrated Control and Redistributable Control (64bits) can only be opened by IE-64bits. IE-32bits can open Redistributable Control (32bits ).
- The webpage is empty: check if the control has installed or you have enable to use the control when you access the webpage. Typically, a warning message will ask you if enable the control.
- The control is black: check if the model is in the correct location. check if it is a supported format. check if NW product can open it.