Is there a way to set pickability of an object from a script?

I would like to instantiate an object and immediately set it to be unpickable, as if I had toggled its pickability state in the hierarchy.

Ah, I have found the answer:

SceneVisibilityManager.instance.DisablePicking(_gameObject, true);

More information here: