How to display or hide lineweights?

The LWDISPLAY system variable is used to control whether the lineweights of objects are displayed.