This sample use AWS S3 to store uploaded client AutoCAD drawing files from local file disk, and initiates Forge Design Automation process Compare
function, results out the AutoCAD drawing with visual differences back to client.
see it live Forge DWG Compare
In order to use this sample you need Autodesk developer credentials. Visit the Forge Developer Portal, sign up for an account, then create an app. Finally take note of the Client ID
and Client Secret
.
Install NodeJS.
Clone this project or download it. It's recommended to install GitHub desktop. To clone it via command line, use the following (Terminal on MacOSX/Linux, Git Shell on Windows):
git clone https://github.com/MadhukarMoogala/fda-dwgcompare.git
To run it, install the required packages, set the environment variables with your Client ID
and Client Secret
, you need AWS AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
, please refer Getting Started AWS and Configuring AWS finally start it. Via command line, navigate to the folder where this repository was cloned and use the following:
Mac OSX/Linux (Terminal)
npm install
export FORGE_CLIENT_ID=<<YOUR CLIENT ID FROM FORGE DEVELOPER PORTAL>>
export FORGE_CLIENT_SECRET=<<YOUR FORGE CLIENT SECRET>>
export AWS_ACCESS_KEY_ID=<<YOUR AWS ACCESS KEY>>
export AWS_SECRET_ACCESS_KEY=<<YOUR AWS ACCESS SECRET>>
export AWS_DEFAULT_REGION=<<YOUR AWS REGION>>
export AWS_PROFILE=<<YOU AWS PROFILE>>
nodemon app
Windows (use Node.js command line
from Start menu)
npm install
set FORGE_CLIENT_ID=<<YOUR CLIENT ID FROM FORGE DEVELOPER PORTAL>>
set FORGE_CLIENT_SECRET=<<YOUR FORGE CLIENT SECRET>>
set AWS_ACCESS_KEY_ID=<<YOUR AWS ACCESS KEY>>
set AWS_SECRET_ACCESS_KEY=<<YOUR AWS ACCESS SECRET>>
set AWS_DEFAULT_REGION=<<YOUR AWS REGION>>
set AWS_PROFILE=<<YOU AWS PROFILE>>
nodemon app
Open the browser: http://localhost:3000.
Create Launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"envFile": "${workspaceFolder}/server/SET.env",
"program": "${workspaceFolder}/app.js"
}
]
}
Create a .env file
#FORGE
FORGE_CLIENT_ID=putyourclientid
FORGE_CLIENT_SECRET=putyoursecret
#AWS
AWS_ACCESS_KEY_ID=putyourawskeyid
AWS_SECRET_ACCESS_KEY=putyourawsaccesskey
AWS_DEFAULT_REGION=us-west-2
AWS_PROFILE=madhukar
Deploy on Heroku
To deploy this application to Heroku, After clicking on the button below, at the Heroku Create New App page, set your
FORGE_CLIENT_ID
,
FORGE_CLIENT_SECRET
,
AWS_ACCESS_KEY_ID
,
AWS_DEFAULT_REGION
,
AWS_PROFILE
This sample is licensed under the terms of the MIT License. Please see the LICENSE file for full details.
Madhukar Moogala (Forge Partner Development) http://forge.autodesk.com