That’s exactly right. I guess that Chamber20nep is your detector construction class? Do you start running your macro commands before the DetectorConstruction has been created?
Hello @mkelsey
Chambe20nep is a piece of the full setup and it is called in the DetectorConstruction. Thanks to your suggestion to run the macro before detectorconstruction is created, I understood the problem. I had to get istance in the detector construction to make working the chamber messenger