yiskang / forge-restore-viewstate-demo

This sample is demonstrating how to manage viewpoints in a viewer panel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Node.js npm Platforms License

Autodesk Forge Viewpoint Management Panel Demo

Overview

This sample is demonstrating how to manage viewpoints in a viewer panel:

  • Save current viewpoint (camera state) into db
  • Retrieve saved viewpoints from db via REST API
  • Store saved viewpoints with a single mouse-clicking on the docking panel

Thumbnail

thumbnail

Requirements

  • node.js v8.9.4 or later

Setup

  1. Download and install Node.js (that will install npm as well)
  2. Download this repo anywhere you want
  3. Execute 'npm install', this command will download and install the required node modules automatically for you.
    npm install

Use of the sample

Before starting the server, you have to set the Forge credentials up.

  • Mac OSX/Linux (Terminal)

    export FORGE_CLIENT_ID=<<YOUR_CLIENT_ID_FROM_DEVELOPER_PORTAL>>
    export FORGE_CLIENT_SECRET=<<YOUR_CLIENT_SECRET>>
  • Windows (use Node.js command line from Start menu)

    set FORGE_CLIENT_ID=<<YOUR_CLIENT_ID_FROM_DEVELOPER_PORTAL>>
    set FORGE_CLIENT_SECRET=<<YOUR_CLIENT_SECRET>>
  • Windows (use Powershell from Start menu)

    $env:FORGE_CLIENT_ID="<<YOUR_CLIENT_ID_FROM_DEVELOPER_PORTAL>>"
    $env:FORGE_CLIENT_SECRET="<<YOUR_CLIENT_SECRET>>"

Then Run the server

npm start

And visit http://127.0.0.1:8089

License

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

Written by

Eason Kang
Forge Partner Development
https://developer.autodesk.com/
https://forge.autodesk.com/blog

About

This sample is demonstrating how to manage viewpoints in a viewer panel

License:MIT License


Languages

Language:JavaScript 77.5%Language:HTML 17.7%Language:CSS 4.9%