Demo application showcasing Configuration with Design Automation for Inventor
Clone repository
Create an APS app at https://aps.autodesk.com/, and select Design Automation API
and Data Management API
in the APIs section
Enter https://localhost:5001 as the callback URL
Note the Client ID
and Client Secret
generated
Specify APS credentials using one of the following approaches:\
a) Set environment variables APS_CLIENT_ID
and APS_CLIENT_SECRET
\
b) Set environment variables Forge__ClientId
and Forge__ClientSecret
\
c) Make a copy of appsettings.Local.template.json
in the WebApplication
directory named appsettings.Local.json
and replace the <clientId>
and <clientSecret>
in it\
d) (not on dev machine) Modify appsettings.json
(or appsettings.<ENVIRONMENT>.json
) with the template mentioned in c)\
e) Set environment variable 'set NODE_ENV=development'
Make a copy of InventorBinFolder.props.template
in the top AppBundles
folder named InventorBinFolder.props
and replace the PATH_TO_YOUR_INVENTOR_BIN
string in it with your actual Inventor bin folder path, for example: C:\Program Files\Autodesk\Inventor 2021\Bin
then right-click on the solution in the Solution Explorer window and select Load All Projects
(Optional) Choose network configuration for your application. By default polling is enabled as it offers an easier way to setup and run the application. This is OK for locally run applications and debugging. However
in production using the new callback option is highly recommended to conserve resources. In order to enable the callback option modify the Publisher
section of the appsettings.json file.
Change "CompletionCheck"
value from "Polling"
to "Callback"
and set "CallbackUrlBase"
url to your server URL or ngrok tunnel URL for a locally run application.
To run and debug callbacks locally please refer to the ngrok section
(Optional) Specify if access should be limited in WebApplication\appsettings.json
. Set Enabled
to true
or false
, and populate the Domains
and Addresses
fields with comma delimited lists such as ["autodesk.com", "company.com"]
and ["person@company2.com", "person@company3.com"]
Open the aps-configurator-inventor.sln
file with Visual Studio 2022 and build the solution
\
This will also generate the zip files of all the app bundles that the web app will need to upload to the Design Automation server\
\
When building the solution, make sure that all those app bundles got generated successfully
\
Now we have to initialize things both on the Design Automation server and locally. In the terminal (in Visual Studio or outside) navigate to the WebApplication
folder and run dotnet run initialize=true
\
Once the output reaches the Now listening on: https://localhost:5001
line just open that URL in your browser\
Next time you'll also be able to start the app from the Visual Studio debugger.
In the Debug drop-down menu select aps-configurator-inventor
and start debugging
This time your browser should open up automatically showing the correct URL
aps-configurator-inventor.sln
file with Visual Studio 2022 and build the solutionWebApplication
directory, and run dotnet build
.WebApplication/ClientApp
and run npm install
. See Adding npm package for more information.WebApplication
directory, run dotnet run initialize=true
WebApplication
directory, run dotnet run clear=true
WebApplication
directory, run dotnet run initialize=true clear=true
WebApplication
directory, and run dotnet run
This site can't be reached
Your Connection is not private
, click Advanced
and then Proceed to localhost (unsafe)
. This is due a development certificate being used.Server/Client
configuration and click the "Start Debugging" (arrow) button
WebApplication.Tests
directory and click on either Run Test
or Debug Test
above one of the methods decorated with the [Fact]
attribute. Or, above the class declaration click on either Run All Tests
or Debug All Tests
WebApplication.Tests
directory run dotnet test
Debug Jest All
configuration and click the "Start Debugging" (arrow) button
npm test
CodeCeptJs
framework. All tests are stored in ClientApp/src/ui-tests/
and we filter all files end with *_test.js
. SDRA_USERNAME
and SDRA_PASSWORD
for Sign-in
workflow. We are using Autodesk Account credentials for Sign-in
."embedded" : true
In appsettings.Local.json
file mentioned in Run sample for the first time
5c)
.env
file in the WebApplication/ClientApp
directory to define the environment variables - for more details follow this link: https://www.npmjs.com/package/dotenvWebApplication/ClientApp
directory:
npx codeceptjs run
or npm run uitest
.npx codeceptjs run src/ui-tests/<test file name>
We are using the APS service on the backend https://aps.autodesk.com/
We are using the latest version of .NET Core (3.1 at the time of writing) https://dotnet.microsoft.com/download/dotnet-core/3.1
The project was initally created using the command dotnet new react
https://aps.autodesk.com/en/docs/design-automation/v3/developers_guide/overview/
C# SDK https://github.com/Autodesk-Forge/forge-api-dotnet-design.automation
We are using the Inventor and Revit engines.
Used for storing your designs. For communication with Design Automation
https://aps.autodesk.com/en/docs/data/v2/developers_guide/overview/
C# SDK https://github.com/Autodesk-Forge/forge-api-dotnet-client
We are using redux-thunk for complex and asynchronous operations https://github.com/reduxjs/redux-thunk
In index.js
replace
const store = createStoreWithMiddleware(mainReducer);
with
const store = createStoreWithMiddleware(mainReducer, window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__());
https://github.com/Autodesk/hig
Table is not part of todays React HIG implementation so we will use https://github.com/Autodesk/react-base-table
We are using npm.
WebApplication/ClientApp
and run npm install <package>
npm_modules
directory is not found. This means that when new packages are added, WebApplication/ClientApp/npm install
needs to be run again manually by other users (who did not add the new package).npm run lint
npm run lint-css
WebApplication.Program.cs
by removing the UseKestrel()
statementUploading your project file can cause the error "Project name or assembly contains unsupported characters". This problem typically happens when you use non Latin characters in your project file names and the zip file does not use UTF-8 encoding for the project file names.
This issue can be fixed by forcing your zip program of choice to zip the file with the UTF-8 encoding
For 7-zip, you can follow these simple steps:
For more information on this issue please refer to the FDA troubleshooting page
ngrok http port
and set the port number the web application uses on your local machinengrok http 5001
{
"Publisher": {
"CompletionCheck": "Callback",
"CallbackUrlBase": "<YOUR NGROK URL>"
}
}
You can read about embedded mode here