Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I copied the following C++ Sample Program from Fusion 360 and Pasted into Visual Studio Academic, which came with Fusion 360 and Tried to build it.
I got Errors on all the header files and lots of errors on most of the lies as highlighted below.
Probably it does not see the header files.
I Have Visual Studio 2010 Installed previously.
How can I set the path for the Project, header and source files for the compile to work properly?
// F360SkCircle.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <Core/Application/Application.h>
#include <Core/Application/Document.h>
#include <Core/Application/Documents.h>
#include <Core/Geometry/Point3D.h>
#include <Core/UserInterface/UserInterface.h>
#include <Fusion/Components/Component.h>
#include <Fusion/Construction/ConstructionPlane.h>
#include <Fusion/Fusion/Design.h>
#include <Fusion/Sketch/Sketch.h>
#include <Fusion/Sketch/SketchCircle.h>
#include <Fusion/Sketch/SketchCircles.h>
#include <Fusion/Sketch/SketchCurves.h>
#include <Fusion/Sketch/Sketches.h>
#include <Fusion/Sketch/SketchPoint.h>
using namespace adsk::core;
using namespace adsk::fusion;
Ptr<UserInterface> ui;
extern "C" XI_EXPORT bool run(const char* context)
{
Ptr<Application> app = Application::get();
if (!app)
return false;
{
Ptr<Application> app = Application::get();
if (!app)
return false;
ui = app->userInterface();
if (!ui)
return false;
if (!ui)
return false;
Ptr<Documents> docs = app->documents();
if (!docs)
return false;
if (!docs)
return false;
// Create a document.
Ptr<Document> doc = docs->add(DocumentTypes::FusionDesignDocumentType);
if (!doc)
return false;
Ptr<Document> doc = docs->add(DocumentTypes::FusionDesignDocumentType);
if (!doc)
return false;
Ptr<Design> design = app->activeProduct();
if (!design)
return false;
if (!design)
return false;
// Get the root component of the active design
Ptr<Component> rootComp = design->rootComponent();
if (!rootComp)
return false;
Ptr<Component> rootComp = design->rootComponent();
if (!rootComp)
return false;
// Create sketch
Ptr<Sketches> sketches = rootComp->sketches();
if (!sketches)
return false;
Ptr<Sketches> sketches = rootComp->sketches();
if (!sketches)
return false;
Ptr<Sketch> sketch = sketches->add(rootComp->xYConstructionPlane());
if (!sketch)
return false;
if (!sketch)
return false;
Ptr<SketchCurves> curves = sketch->sketchCurves();
if (!curves)
return false;
if (!curves)
return false;
// Draw some circles.
Ptr<SketchCircles> circles = curves->sketchCircles();
if (!circles)
return false;
Ptr<SketchCircles> circles = curves->sketchCircles();
if (!circles)
return false;
Ptr<SketchCircle> circle1 = circles->addByCenterRadius(Point3D::create(0, 0, 0), 2);
if (!circle1)
return false;
if (!circle1)
return false;
Ptr<SketchCircle> circle2 = circles->addByCenterRadius(Point3D::create(8, 3, 0), 3);
if (!circle2)
return false;
if (!circle2)
return false;
// Add a circle at the center of one of the existing circles.
circles->addByCenterRadius(circle2->centerSketchPoint(), 4);
circles->addByCenterRadius(circle2->centerSketchPoint(), 4);
return true;
}
}
#ifdef XI_WIN
#include <windows.h>
BOOL APIENTRY DllMain(HMODULE hmodule, DWORD reason, LPVOID reserved)
{
switch (reason)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
{
switch (reason)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
#endif // XI_WIN
1>------ Build started: Project: F360SkCircle, Configuration: Debug Win32 ------
1>Build started 2018-08-25 10:32:28 AM.
1>PrepareForBuild:
1> Creating directory "c:\users\tpera\documents\visual studio 2010\Projects\F360SkCircle\Debug\".
1>InitializeBuildStatus:
1> Creating "Debug\F360SkCircle.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>ClCompile:
1> stdafx.cpp
1> F360SkCircle.cpp
1>c:\users\tpera\documents\visual studio 2010\projects\f360skcircle\f360skcircle\f360skcircle.cpp(7): fatal error C1083: Cannot open include file: 'Core/Application/Application.h': No such file or directory
1>
1>Build FAILED.
Solved! Go to Solution.