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.
Returns a 2-legged OAuth token with viewables:read
scope.
GET https://forgist.autodesk.io/api/token
{
"access_token": "<access-token>",
"expires_in": <expiration-time-in-seconds>
}
Returns a collection of sample models ready for viewing.
GET https://forgist.autodesk.io/api/models
[
{
"name": "<name-of-model>",
"urn": "<model-urn>"
},
{
"name": "<name-of-model>",
"urn": "<model-urn>"
},
{
"name": "<name-of-model>",
"urn": "<model-urn>"
}
]
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.
Thumbnail | Name | Credit |
---|---|---|
rac_basic_sample_project.rvt | Autodesk Revit 2019 sample files | |
rac_advanced_sample_project.rvt | Autodesk Revit 2019 sample files | |
rst_basic_sample_project.rvt | Autodesk Revit 2019 sample files | |
rst_advanced_sample_project.rvt | Autodesk Revit 2019 sample files | |
rme_basic_sample_project.rvt | Autodesk Revit 2019 sample files | |
rme_advanced_sample_project_.rvt | Autodesk Revit 2019 sample files |