Hiding trends by legend selection in PA view

I have a PA trend view like:

I can 'hide' the USL_dia and LSL_dia by de-selecting these trends in the legend

Can you do this also via cicode?

_ObjectCallMethod(hPen3, "Delete");   will delete the pen.

Can you use a 'deselect' or 'hide' command in this _ObjectcallMethode()?