ClearGroup - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

# Online Help

###### All Products    Maple    MapleSim

DocumentTools[Canvas][Script]

 ClearGroup
 clear the elements from the active canvas group

 Calling Sequence ClearGroup()

Description

 • 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.

Examples

In this example, we will create a canvas, then use a script to change an entry and then clear the group

 > $\mathrm{with}\left(\mathrm{DocumentTools}:-\mathrm{Canvas}\right):$

create a canvas with a group of items and a button that clears the group and then inserts new text

 > $\mathrm{with}\left(\mathrm{DocumentTools}:-\mathrm{Canvas}\right)$
 > ClearGroup := proc(canvas)    local sc := Script();    SetActive(sc,"G");    ClearGroup(sc);    SetText(sc,"insert after clear");    ToString(sc); end proc:
 > $\mathrm{cv}≔\mathrm{NewCanvas}\left(\left["Test ClearGroup",\mathrm{Group}\left(\left[\mathrm{Text}\left("text",\mathrm{custom}="T"\right),1,2,3\right],\mathrm{custom}="G"\right),\mathrm{ScriptButton}\left("Clear Group",\mathrm{ClearGroup},\mathrm{position}=\left[500,60\right]\right)\right]\right):$
 > $\mathrm{ShowCanvas}\left(\mathrm{cv}\right)$

Compatibility

 • The DocumentTools[Canvas][Script][ClearGroup] command was introduced in Maple 2023.
 • For more information on Maple 2023 changes, see Updates in Maple 2023.

 See Also