Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Adding Fusion 360 support to an exisiting application

0 REPLIES 0
Reply
Message 1 of 1
BlackPrism
216 Views, 0 Replies

Adding Fusion 360 support to an exisiting application

Can anybody help?

 

I have an existing C# application, originally written for SolidWorks, and would like connect it to Fusion; a complete rewrite isn't really an option.

 

I first thought of using Python for the Fusion API and IronPython from the C# app to call the Python code, but IronPython doesn't recognise import adsk.core, adsk.fusion.............. So went back to the drawing board, thinking I could use C++, but as soon as I add code to get a pointer to the Fusion application the dll import in C# fails; unable to find the specified module error.

 

// Fusion.dll cpp file
#include <Windows.h>

#include <Core/CoreAll.h>
#include <Fusion/FusionAll.h>

using namespace adsk::core;
using namespace adsk::fusion;

extern "C" __declspec(dllexport) bool SketchCircles() {
	
	static Ptr<Application> app = Application::get();
	if (!app)
		return false;

	return true;
}
    //C# implementation
    public static class FusionWrapper
    {
        private const string dllPath = @"D:\Fusion API\ConnectionTest\Debug\ConnectionTest.dll";

        [DllImport(dllPath, EntryPoint = "SketchCircles", CallingConvention = CallingConvention.StdCall)]
        public static extern bool SketchCircles();
    }

 

What am I missing?

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report