setScheduleEditing Method @beta
Begins or updates a schedule script editing session for the current display style.
During an editing session, changes to the schedule script are applied incrementally
using temporary dynamic tiles, allowing for interactive preview of visual changes like color,
transforms, visibility, and cutting planes — without requiring a full tile tree reload.
Calling this method multiple times will update the current editing session with new script changes.
When all edits are complete, you must invoke commitScheduleEditing to finalize the session and
trigger a full tile tree refresh with the committed script.
setScheduleEditing(newScript: RenderSchedule.Script): void
@note You cannot use schedule script editing while a
@see GraphicalEditingScope is active.
Example:
/** Applies color and visibility changes to a specified element using interactive
* schedule script editing.
* Note that a real workflow would involve user interaction between each call to `setScheduleEditing`.
*/
export function editElementTimeline(vp: Viewport, elementId: Id64String, modelId: Id64String): void {
const builder = new RenderSchedule.ScriptBuilder();
const now = Date.now();
const modelTimeline = builder.addModelTimeline(modelId);
const elementTimeline = modelTimeline.addElementTimeline([elementId]);
// Change color over time
elementTimeline.addColor(now, new RgbColor(255, 0, 0));
elementTimeline.addColor(now + 3000, new RgbColor(0, 255, 0));
// Enter interactive script editing mode
let script = RenderSchedule.Script.fromJSON(builder.finish());
assert(script !== undefined);
vp.displayStyle.setScheduleEditing(script);
// Change visibility over time
elementTimeline.addVisibility(now, 0); // fully transparent
elementTimeline.addVisibility(now + 3000, 100); // fully visible
// Update the script under construction
script = RenderSchedule.Script.fromJSON(builder.finish());
assert(script !== undefined);
vp.displayStyle.setScheduleEditing(script);
// ...make some other changes to the script if desired...
// Commit changes, triggering full graphical refresh.
vp.displayStyle.commitScheduleEditing();
}
Returns - void
Defined in
Last Updated: 29 July, 2025