About refreshing custom display

Hi everyone. Is there any way to refreshing the accumulating geometry drawn on the screen by custom display, as shown by the pictures below? Thanks.
1649455143(1)


If your cd variable is declared inside a function, then it is created anew each time.

You need to maintain a class level variable for that, construct it only once, and then either wipe or append to it depending on the state of the ‘dispose’ input.

Thanks David! I put the cd variable outside the function and it works!