Code Monkey home page Code Monkey logo

forgist's Introduction

forgist

Autodesk Forge application providing authentication, sample data, and client side utilities for various code snippet websites such as jsfiddle or codepen.

If you're interested in seeing additional APIs and models other than those listed below, submit a feature request.

codepen screenshot

Endpoints

GET /api/token

Returns a 2-legged OAuth token with viewables:read scope.

Request

GET https://forgist.autodesk.io/api/token

Response

{
    "access_token": "<access-token>",
    "expires_in": <expiration-time-in-seconds>
}

GET /api/models

Returns a collection of sample models ready for viewing.

Request

GET https://forgist.autodesk.io/api/models

Response

[
    {
        "name": "<name-of-model>",
        "urn": "<model-urn>"
    },
    {
        "name": "<name-of-model>",
        "urn": "<model-urn>"
    },
        {
        "name": "<name-of-model>",
        "urn": "<model-urn>"
    }
]

Client Utilities

When writing a code snippet, you would typically initialize the viewer and load models using the official Forge Viewer APIs. In cases where you don't want to set things up manually, consider using the utility script https://forgist.autodesk.io/client/utils.js. It adds a forgist object into the global scope with several helper functions, for example, a setup function which automatically initializes the viewer in provided HTML element, and loads one of the predefined models either by its name or index:

forgist.setup(document.getElementById('viewer'), 2).then(viewer => {
  const dbids = viewer.getSelection();
  console.log(dbids);
});

Oh, and here's a quick link to Create New Codepen with this snippet.

See code comments in https://forgist.autodesk.io/client/utils.js for more details and usage examples.

Models

Thumbnail Name Credit
rac_basic_sample_project.rvt rac_basic_sample_project.rvt Autodesk Revit 2019 sample files
rac_advanced_sample_project.rvt rac_advanced_sample_project.rvt Autodesk Revit 2019 sample files
rst_basic_sample_project.rvt rst_basic_sample_project.rvt Autodesk Revit 2019 sample files
rst_advanced_sample_project.rvt rst_advanced_sample_project.rvt Autodesk Revit 2019 sample files
rme_basic_sample_project.rvt rme_basic_sample_project.rvt Autodesk Revit 2019 sample files
rme_advanced_sample_project_.rvt rme_advanced_sample_project_.rvt Autodesk Revit 2019 sample files

forgist's People

Contributors

petrbroz avatar

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.