Skip to main content

AutodeskPin

Utilize Contextual Comments to integrate a personalized commenting feature into your Autodesk model. This enables participants to add comments to specific locations within the Autodesk model, viewable by everyone in the room.

Before we start

It is important to initialize a room with a defined name and ID for the participant and for the group, as it will be used to store the comment data on our servers.

Initializing Autodesk

To initialize the Contextual Comments for Autodesk, you will need to first have a viewer instance from Autodesk, similar to the code below:

const viewer = new Autodesk.Viewing.GuiViewer3D(viewerDiv, config3d);

The minimum Autodesk Platform Services Viewer version required is 7**.**

Installing SuperViz Autodesk extension

The AutodeskPin adapter is not available from the @superviz/sdk package, instead, to use it you must use the @superviz/autodesk-viewer-plugin package.

To use the @superviz/autodesk-viewer-plugin package please add the script below before the </head>

<script type="module" src="https://unpkg.com/@superviz/autodesk-viewer-plugin@latest"></script>

How to use it

Before creating the Comments component, you will to use AutodeskPin adapter. To construct it, you will need to pass the Autodesk viewer where it’s loaded.

import { AutodeskPin } from '@superviz/autodesk-viewer-plugin';

// element where the Autodesk will be loaded
const viewerElement = document.getElementById("autodesk-viewer-id");

// Autodesk intance
const viewer = new Autodesk.Viewing.GuiViewer3D(viewerDiv, config3d);

// Creating a Autodesk adapter
const pinAdapter = new AutodeskPin(viewer);
warning

Please, make sure to only initialize the adapter once the Autodesk Viewer is fully loaded, otherwise you won’t be able to initialize the use of the component.

Properties

See below the parameters to use in the constructor of the AutodeskPin:

NameTypeDescription
viewerGuiViewer3DRequired. An instance of the Autodesk Viewer.

Adding Comments Component

After initializing the AutodeskPin, you can pass it as a parameter for the Comments component, like the following code:

import { Comments } from '@superviz/sdk/lib/components';
import { AutodeskPin } from '@superviz/autodesk-viewer-plugin';

// Element where the Autodesk will be loaded
const viewerElement = document.getElementById("autodesk-viewer-id");

// Autodesk intance
const viewer = new Autodesk.Viewing.GuiViewer3D(viewerDiv, config3d);

// Creating a AutodeskPin adapter
const pinAdapter = new AutodeskPin(mpSDK);

// Construct the Comments with the AutodeskPin adapter
const comments = new Comments(pinAdapter);
room.addComponent(comments);