S3D.graphics


The S3D.graphics namespace is where you can interact with the rendered model in the viewport.


S3D.graphics.highlightElement#

Description: Allows highlighting of model elements.

Operation Type: Synchronous

Params: S3D.graphics.highlightElement(elementType, elementId)

KeyTypeAcceptsDescription
elementTypestringnode, member, plate, etc.This can be obtained via S3D.structure.get().
elementIdintegerAn element ID.The new file name of the model.

Sample:

highlightElement.js
S3D.graphics.highlightElement('member', 12); // Highlight member 12

S3D.graphics.locator#

Description: Displays an animation to locate a model element.

Operation Type: Synchronous

Params: S3D.graphics.locator(elementType, elementId)

KeyTypeAcceptsDescription
elementTypestringnode, member, plate, etc.This can be obtained via S3D.structure.get().
elementIdintegerAn element ID.The new file name of the model.

Sample:

graphicLocator.js
S3D.graphics.locator('node', 6);

S3D.graphics.refreshAllCanvas#

Description: Offers a fast, lightweight redraw function. Useful for highlighting any non-model changes that need re-rendering.

Operation Type: Asynchronous

Params: S3D.graphics.refreshAllCanvas(callback?)

Sample:

refreshCanvas.js
function callback() {
// Do something when finished.
}
S3D.graphics.refreshAllCanvas(callback);

S3D.graphics.screenshot#

Description: Take a screenshot of the model.

Operation Type: Asynchronous

Params: S3D.graphics.screenshot(callback?)

Sample:

screenshot.js
function callback(screenshotData) {
// The screenshot data will be in base64 format.
// This string can be added to the src property of an HTML img element to display the image.
console.info(screenshotData);
}
S3D.graphics.screenshot(callback);