Issue by using Autodesk.Naviswork.api - not found

Issue by using Autodesk.Naviswork.api - not found

Anonymous
Not applicable
1,123 Views
1 Reply
Message 1 of 2

Issue by using Autodesk.Naviswork.api - not found

Anonymous
Not applicable

Hello all,

 

I am recently trying to create some plugins for Naviswork 2017 by following the training labs proposed. So to explain briefly, I am executing the code already given in the package (I put the package folder in my computer C:\), but unfortunately it does not work and indicate the following message:

bug.PNG

Globally it says as first errror "The 'autodesk' type or namespace name was not found"

 

I think it comes from the fact Autodesk.Naviswork.Api is not found but I have no idea how to solve that...

Could you advise me on how to do please ? 🙂

 

Thanks a lot !

Ludovic

0 Likes
1,124 Views
1 Reply
Reply (1)
Message 2 of 2

ulski1
Collaborator
Collaborator

Hi,

The issue you are having is that the training labs sample code was made for a different version of Navisworks than the one you have installed. I would recommend that you download and install the Navisworks SDK if you haven’t done that already, and look at the sample code in C:\Program Files\Autodesk\Navisworks Simulate 2019\api\NET\examples

 

But you can get the old training labs code to work with your version of Navisworks. In csharp projects it is a standard thing to add references to classes inside dll files created by other people (or in this case created by Autodesk). These class references depends on the dll file to be found on the harddrive. If you get that the classes like Autodesk.navisworks.api can not be found it means that the dll file Autodesk.Navisworks.Api.dll  is not on your pc because you haven’t installed Navisworks or more likely it means the version of Navisworks you installed (Simulate or Manage + year number) doesn’t match up with the HintPath or ReferencePath in the csproj file used by your csharp project. You can open the csproj file for the project in notepad or another editior (you need to close visual studio first) or you can open it inside visual studio if you “unload the project”. When you have the csproj file open look for lines like this and verify that the path to the Navisworks folder is correct.:

 

    <Reference Include="Autodesk.Navisworks.Api">

      <SpecificVersion>False</SpecificVersion>

      <HintPath>C:\Program Files\Autodesk\Navisworks Simulate 2019\Autodesk.Navisworks.Api.dll</HintPath>

      <Private>False</Private>

    </Reference>

 

Br

Ulrik

0 Likes