.NET API - cannot load the DLL files

.NET API - cannot load the DLL files

Anonymous
Not applicable
925 Views
1 Reply
Message 1 of 2

.NET API - cannot load the DLL files

Anonymous
Not applicable

Hi, 

 

I am trying to use the API but every time I run my application, it comes up with the following errors depending on which "Platform target" option I choose.

anycpu.png

 

x86x64.png

 

This is my simple program:

using System;

using Autodesk.Navisworks.Api;

namespace ConsoleApp4
{
    class Program
    {
        static void Main(string[] args)
        {
            Document doc = Autodesk.Navisworks.Api.Application.ActiveDocument;
            Console.WriteLine(doc.Title);
        }
    }
}

The DLL files are located in "C:\Program Files\Autodesk\Navisworks Manage 2019" where I load them from. See below:

 

references.png

 

I tried to copy the files to a different folder - this does not help. I also have a full professional licence. Any ideas how to make this work?

0 Likes
926 Views
1 Reply
Reply (1)
Message 2 of 2

xiaodong_liang
Autodesk Support
Autodesk Support

Hi @Anonymous ,

 

if you wanted to build a standalone EXE program(such as Console or Winform ), you will need to work with Automation API + Plugin API of Navisworks

if you wanted to build a plugin only, you will need to build a class, instead of Console or Winform or else.

if you wanted to build a standalone EXE program with Viewer, you will need to work with .NET Control API.

 

I would suggest you take a look at the basic tutorial of Navisworks API:

http://images.autodesk.com/adsk/files/Navisworks_Training_Labs_2015_0921.zip

0 Likes