1 Expert: Scripting - Access the sheetBuild API

Overview of Scripting Capabilities

Sheetbuild scripting offers a robust platform for enhancing your spreadsheets and 3D models with JavaScript. By utilizing events and the scripting capabilities, you can create a more interactive and responsive environment within your projects.

Programming Language:

JavaScript: Scripts are written in JavaScript, providing a familiar and powerful language for developers.

Key Functionalities:

  • Data Manipulation:
    Easily read from and write to sheet cells, allowing for dynamic data operations.

  • UI Enhancement:
    Integrate additional controls and features into the user interface.

  • Scene Interaction:
    Enhance the interactivity of 3D scenes through custom scripts.

Event Handling in Sheetbuild

Scripts in Sheetbuild can respond to a variety of events within the project or scene, enabling reactive and dynamic behaviors.

Project-Level Events

- OnLoaded()
Triggered when the project loads, this event is ideal for initializing settings or UI elements.

- OnSelected()
Activated when an element within the project is selected, useful for context-sensitive operations.

Scene-Level Events

These events are specific to interactions within the 3D scenes:

- MouseOver(event)
Occurs when the mouse pointer hovers over a scene object, useful for displaying tooltips or additional information.

- MouseDown(event)
Triggered by a mouse click on a scene object, often used to initiate an action.

- MouseUp(event)
Detects when the mouse button is released, commonly used to finalize an action started with MouseDown.

Practical Example

Consider a scenario where you need to display specific data when a user hovers over a part of the 3D model. Using the `MouseOver(event)` handler, you can set up a script that fetches and displays data relevant to the part being hovered over, enhancing user interaction without cluttering the UI with persistent labels.