Is it possible to use the Navisworks Manage 2013 .NET API to edit unopened nwd documents etc. I am proposing to set up a webservice that utilises the NET API on the same server as the Navisworks Manage 2013 installation. I would then like the ability to call this webservice remotely and update a particular file on the server i.e. by adding a label etc to a particular object in the file. Using file name/server location only Is it possible to get the equivalent details that would be returned by Autodesk.Navisworks.Api.Application.ActiveDocument variable in a normal plugin scenario.
To edit a Navisworks file, you would either start a Navisworks instance, or a .NET control application, and open the file. But for the formmer, you could make instance invisible.
And you will need to write an automation application and one plugin to do the modification (both on the server with Navisworks installed). When the client calls the ability, the automation runs to call the plugin.
In addition, the blog below shows how to add label/url to the object
I have previously successfully implemented a plugin in navisworks utilising .net API to write hyperlinks /labels to specified objects using the details found at the link you provided.
Are you saying that on a client machine I could make a web-service call with details of an object selected in Redistributable Active x model to an Automation application on remote ( navisworks installed server) which would silently open model and edit it with plugin and then close.
Could I then have the model refresh on the client machine in Redistributable Active X to reflect update to model. This would give the impression of real time model updating from a client machine. Can the Automation application be called from a client side Active X as opposed to a seperate web-service call
NO, Redistributable Active x has limited ablities. You cannot even access current selection with it.
What I meant by 'client' is: at client side, your interface just provided a button called 'add label to my model'. When the button is clicked, the sever can know it needs to launch the automation application, while the automation knows to call the plugin to execute. In another word, no view at client end.
Of course, the assumption is: the server knows which object is needed to add label.
I understand you want to have abillity to use Redistributable Active x only to do the job, taking advantage of the automation & plugin in the server. However, since Redistributable Active x does not tell you with the current selection, I have not a way to make them feasible. Sorry.
If you use Integrated control, all things can be done at client end.
One more I have ever suggested is to ask your users to access your desktop remotely and run the app remotely. but yes, this is not a solution. It is just for inner use within your group.
If you just want to refresh the view in client with the update on server, it is possible. You will just need to load the model again.
Many thanks for coming back to me on this issue. As as aside if we use the integrated model have you an example of VBScript code to call a plugin/automation etc through the integrated active x. I have created a navisworks plugin using your example for adding links to model using .NET API. If we could call that on the server it would at least help witth integrating the functionality into a website without user having to open navisworks manually.
What I meant is to start your automation (EXE) (which is on the server) by VBScript. I did not try this, but it looks feasible to me. If you google with "VBScript start process", you may get some clue.
BUT, since you plan to use Integreated control which is fully enabled with API, you can just load the model and modify it directly (without other automation + plugin ). After saving, you may need to upload the newest version to override the version on the server. Sorry I am far from being an expert of web, I have not much information for it.
I have tried a few other ways of updating model in website. One is to try and call an automation plugin from vbscript and pass in relevant parameters.I am using the below code.
public function btnStartPlugin()
aString = "Hello"
plugin2 = "AM_HyperLinks.MyAddIn"
Set app = CreateObject("NavisWorks.Document")
'make sure it's visible
app.visible = true
However the website I am currently trying this on has a trial version installed. So everytime I run vbscript to run plugin the buy now or try message appears as part of Navisworks load. Once I accept to try it closes window and causes a console error that Navisworks.Document could not be opened. Is this trial copy popup interfering with the automation call process.
As we are working with the integrated model you had suggested working diretcly with models using API etc. If I use the default integrated Active X how can I access model properties using C# etc in our website. I have tried creating an Active X of our own using examples in api folders but I am currently having a lot of hassle with Visual Web Developer.
I get the following error
Warning 1 Task attempted to find "AxImp.exe" in two locations. 1) Under the "C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\" processor specific directory which is generated based on SdkToolsPath 2) The x86 specific directory under "C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\" which is specified by the SDKToolsPath property. You may be able to solve the problem by doing one of the following: 1) Set the "SDKToolsPath" property to the location of the Microsoft Windows SDK. ActiveXFindExample
Looking into this I tried downlaoding the relevant SDK for Visual Studio but this only works in Visual Studio 2010 on as opposed to Visual Web Developer. If I could get this working I might be able to create our own active x/windows form and embed it in website and do all relevant linking of model to databse items in website.
Have you any suggestions with regards to both approaches. I would imagine that the second approach would give you more power over models. I will try and access these projects on a 32 bit system with Visual Studio 2010 installed but If I am not able is there any other ways around the aximp error above.
firstly, it looks you are trying to execute a .NET plugin from the application of COM ? This is not a support way. In Navisworks, COM API cannot call .NET API. .NET API can call COM by COM bridge, as you have known. So,
either call COM plugin. I did not try. In theory, I think it is possible
or, you create an automation of .NET API (EXE), this EXE calls the .NET plugin. In your web application (COM), start the EXE.
about access properties by C#, please take a look at
C:\Program Files\Autodesk\Navisworks Manage 2013\api\COM\examples\Auto\AutoUserPropsExample
It is written in C#. Probably you could get some idea there.
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.