clear the elements from the active canvas group
The ClearGroup command removes the math and text contents of the active canvas group, leaving the group intact with a single empty math container inside. Designate which group to clear by using the SetActive command prior to calling ClearGroup.
A "canvas" is an interactive section of a Maple document created by the NewCanvas command, or a shared web-based Maple Learn document. See the Script command for a more complete description.
In this example, we will create a canvas, then use a script to change an entry and then clear the group
create a canvas with a group of items and a button that clears the group and then inserts new text
ClearGroup := proc(canvas)
local sc := Script();
SetText(sc,"insert after clear");
cv ≔ NewCanvas⁡Test ClearGroup,Group⁡Text⁡text,custom=T,1,2,3,custom=G,ScriptButton⁡Clear Group,ClearGroup,position=500,60:
The DocumentTools[Canvas][Script][ClearGroup] command was introduced in Maple 2023.
For more information on Maple 2023 changes, see Updates in Maple 2023.
Download Help Document