Message 1 of 1
Adding Fusion 360 support to an exisiting application

Not applicable
01-04-2018
07:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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?