Git Product home page Git Product logo

aps-design-automation-nodejs's Introduction

APS Design Automation

Node.js npm Platforms License

oAuth2 Data-Management Design-Automation

Basic

Description

Webapp interface that uses Design Automation to update the width and height param of DWG Dynamic Block (using AutoCAD), RVT Window Family instance (using Revit), IPT Part parameters (using Inventor) and 3DS ... (using 3dsMax). Also includes a Clear Account (remove all AppBundles and Activities) and Define new Activity based on the sample code.

See other projects for bundles.

Thumbnail

modify-your-models.mp4

Setup

To use this sample, you will need Autodesk developer credentials. Visit the APS Developer Portal, sign up for an account, then create an app. For this new app, use http://localhost:8080/api/aps/callback/oauth as the Callback URL, although it is not used on a 2-legged flow. Finally, take note of the Client ID and Client Secret.

Running locally

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/autodesk-platform-services/aps-design-automation-nodejs.git

To run it, install the required packages, set the enviroment variables with your client ID, Secret and ngrok url and finally start it. Via command line, navigate to the folder where this repository was cloned to and use the following commands:

Mac OSX/Linux (Terminal)

npm install
export APS_CLIENT_ID=<<YOUR CLIENT ID FROM DEVELOPER PORTAL>>
export APS_CLIENT_SECRET=<<YOUR CLIENT SECRET>>
npm start

Windows (use Node.js command line from the Start menu)

npm install
set APS_CLIENT_ID=<<YOUR CLIENT ID FROM DEVELOPER PORTAL>>
set APS_CLIENT_SECRET=<<YOUR CLIENT SECRET>>
npm start

Open the browser: http://localhost:8080.

How to use this sample

Open http://localhost:8080 to start the app, if first time, click on Configure(right top) select the bundle and engine and click on Create/Update this will create an activity. Enter new width & height values, select the input file (use from sample files folder), select the Activity and, finally, Start workitem.

Debugging Locally

To run or debug a simple app in VS Code, select Run and Debug on the Debug start view or press F5 and VS Code will try to run your currently active file.

However, for most debugging scenarios, creating a launch configuration file is beneficial because it allows you to configure and save debugging setup details. VS Code keeps debugging configuration information in a launch.json file located in a .vscode folder in your workspace (project root folder) or in your user settings or workspace settings.

To create a launch.json file, click the create a launch.json file link in the Run start view.

launch configuration

VS Code will try to automatically detect your debug environment, but if this fails, you will have to choose it manually

debug environment selector

Here is the launch configuration generated for Node.js debugging

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "pwa-node",
            "request": "launch",
            "name": "Launch Program",
            "program": "${workspaceFolder}/start.js",
            "env": {
                "APS_CLIENT_ID": "your clientid here",
                "APS_CLIENT_SECRET": "your client secret here"
            }
        }
    ]
}

Further Reading

Documentation:

Packages used

The APS SDK packages are included by default. Some other non-Autodesk packages are used, including express and multer for upload.

Tips & tricks

For local development/ testing, consider using the nodemon package, which auto-restarts your node application after any modification to your code. To install it, use:

sudo npm install -g nodemon

Then, instead of npm run dev, use the following:

npm run nodemon

Which executes nodemon server.js --ignore www/, where the --ignore parameter indicates that the app should not restart if files under the www folder are modified.

Troubleshooting

After installing GitHub Desktop for Windows, on the Git Shell, if you see the error setting certificate verify locations error, then use the following command:

git config --global http.sslverify "false"

License

This sample is licensed under the terms of the MIT License. Please see the LICENSE file for full details.

Written by

Autodesk APS @AutodeskAPS, APS Partner Development

aps-design-automation-nodejs's People

Contributors

adamenagy avatar augustogoncalves avatar chandra6ma avatar cyrillef avatar jaimerosales avatar kevinvandecar avatar libvarun avatar madhukarmoogala avatar naveen-kumar-thalaivirichan avatar petrbroz avatar pranavtotla avatar xiaodongliang avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

aps-design-automation-nodejs's Issues

aps-design-automation-nodejs - 3DS Max bundle issue

[01/24/2024 10:12:49] Start 3DS Max Core Engine standard output dump.
[01/24/2024 10:12:49] 1/24/2024 10:12:49 AM; 3ds Max Install Location: T:\Aces\AcesRoot\26.2.0.22013\coreEngine
[01/24/2024 10:12:49] 1/24/2024 10:12:49 AM; 3ds Max Executable: 3dsmax.exe
[01/24/2024 10:12:49] 1/24/2024 10:12:49 AM; Secure Mode: 'OFF'
[01/24/2024 10:12:49] 1/24/2024 10:12:49 AM; Script command: " -mxs "(filein @"T:\Aces\Jobs\6a938020d78e438189467d919a29f8d8\setting_script.ms")""
[01/24/2024 10:12:49] 1/24/2024 10:12:49 AM; Scene File: "T:\Aces\Jobs\6a938020d78e438189467d919a29f8d8\20240124101245_input_max_sample_file.max"
[01/24/2024 10:12:51] 1/24/2024 10:12:51 AM; Product version: 3ds Max 2024.2 Update (26.2.0.22013)
[01/24/2024 10:12:51] 1/24/2024 10:12:51 AM; Data collection and use: personalize your experience and help us identify product improvements by participating in our data collection and usage programs. Learn more about data collection and use: https://www.autodesk.com/company/autodesk-analytics. Autodesk's Privacy Statement: https://www.autodesk.com/company/legal-notices-trademarks/privacy-statement
[01/24/2024 10:12:51] 1/24/2024 10:12:51 AM; Data collection and use is 'OFF'. Change your participation anytime in the Help menu of 3ds Max.
[01/24/2024 10:13:24] 1/24/2024 10:13:24 AM; Initializing Python version: 3.10.8
[01/24/2024 10:13:26] 1/24/2024 10:13:26 AM; MAXScript ExecuteMAXScriptScript Exception: -- Unable to convert: undefined to type: String; Error occurred in anonymous codeblock; filename: T:\Aces\Jobs\6a938020d78e438189467d919a29f8d8\setting_script.ms; position: 78; line: 1
[01/24/2024 10:13:26] 1/24/2024 10:13:26 AM; MAXScript -mxs Switch Exception: -- Unable to convert: undefined to type: String
[01/24/2024 10:13:27] 1/24/2024 10:13:27 AM; Task Completed with Error(s) - see above
[01/24/2024 10:13:30] End 3DS Max Core Engine standard output dump.
[01/24/2024 10:13:30] End script phase.
[01/24/2024 10:13:30] Start upload phase.
[01/24/2024 10:13:30] Error: Non-optional output [outputFile.max] is missing.
[01/24/2024 10:13:30] Error: An unexpected error happened during phase Publishing of job.
[01/24/2024 10:13:57] Job finished with result FailedMissingOutput
[01/24/2024 10:13:57] Job Status:
{
"status": "failedInstructions",
"reportUrl": "https://dasprod-store.s3.amazonaws.com/workItem/GAVAWtjKONGGhRaKsTNPySCGp6NoccaD/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V%2F20240124%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240124T101248Z&X-Amz-SignedHeaders=host&X-Amz-Signature=5ac1b9e3ab443fde6a9e395369ca52a9638478ac86b3693891ac407a67cb6baa",
"stats": {
"timeQueued": "2024-01-24T10:12:48.8312071Z",
"timeDownloadStarted": "2024-01-24T10:12:48.9612191Z",
"timeInstructionsStarted": "2024-01-24T10:12:49.5215066Z",
"timeInstructionsEnded": "2024-01-24T10:13:30.8474389Z",
"timeUploadEnded": "2024-01-24T10:13:30.8480291Z",
"bytesDownloaded": 733211

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.