COMMAND NOT FOUND <<?xml version='1.0' encoding='ASCII'?>> *****

_Geant4 Version: 10.4.3
_Operating System: macOS Sonoma 14.5
_Compiler/Version: Apple clang 15.0
_CMake Version: 3.25.1

I’m building my geometry through a GDML file. I’ve already tested the GDML geometry with the gdml/G01 example and with the ROOT visualizer.
However, when running the main code this is the console output:

Available UI session types: [ GAG, tcsh, csh ]
G4GDML: Reading 'CriostatoTest0606.gdml'...
G4GDML: VALIDATION ERROR! ID attribute 'G4_BRASS' is referenced but was never declared at line: 18539
G4GDML: VALIDATION ERROR! ID attribute 'G4_Galactic' is referenced but was never declared at line: 18539
G4GDML: VALIDATION ERROR! ID attribute 'G4_Al' is referenced but was never declared at line: 18539
G4GDML: VALIDATION ERROR! ID attribute 'G4_Cu' is referenced but was never declared at line: 18539
G4GDML: VALIDATION ERROR! ID attribute 'G4_Ni' is referenced but was never declared at line: 18539
G4GDML: VALIDATION ERROR! ID attribute 'G4_Si' is referenced but was never declared at line: 18539
G4GDML: Reading definitions...
G4GDML: Reading materials...
G4GDML: Reading solids...
G4GDML: Reading structure...
G4GDML: Reading setup...
G4GDML: Reading 'CriostatoTest0606.gdml' done!
Stripping off GDML names of materials, solids and volumes ...

**************************************************************
 Geant4 version Name: geant4-10-04-patch-03    (8-February-2019)
                       Copyright : Geant4 Collaboration
                      References : NIM A 506 (2003), 250-303
                                 : IEEE-TNS 53 (2006), 270-278
                                 : NIM A 835 (2016), 186-225
                             WWW : http://geant4.org/
**************************************************************

1 - Defining DecayPhysics
2 - Defining RadioactiveDecayPhysics
3 - Defining Standard em
***** COMMAND NOT FOUND <<?xml version='1.0' encoding='ASCII'?>> *****

***** Batch is interrupted!! *****

How can fix it? And why does it not show the same for G01 example?

I’ve found also another problem: visualizing with Heprep the loading of my gdml both in G01 and G04 example, only a small amount of the geometry is seen by the visualizer. However when I tested my GDML file loading with root visualizer I’ve seen all the volumes rightfully loaded.
I can even see that the DetectorConstruction reads all the auxiliary informations of the other volumes:

Usage: gdml_det <intput_gdml_file:mandatory>

Available UI session types: [ GAG, tcsh, csh ]
G4GDML: Reading 'CriostatoTest0606.gdml'...
G4GDML: VALIDATION ERROR! ID attribute 'G4_BRASS' is referenced but was never declared at line: 18540
G4GDML: VALIDATION ERROR! ID attribute 'G4_Galactic' is referenced but was never declared at line: 18540
G4GDML: VALIDATION ERROR! ID attribute 'G4_Al' is referenced but was never declared at line: 18540
G4GDML: VALIDATION ERROR! ID attribute 'G4_Cu' is referenced but was never declared at line: 18540
G4GDML: VALIDATION ERROR! ID attribute 'G4_Ni' is referenced but was never declared at line: 18540
G4GDML: VALIDATION ERROR! ID attribute 'G4_Si' is referenced but was never declared at line: 18540
G4GDML: Reading definitions...
G4GDML: Reading materials...
G4GDML: Reading solids...
G4GDML: Reading structure...
G4GDML: Reading setup...
G4GDML: Reading 'CriostatoTest0606.gdml' done!
Stripping off GDML names of materials, solids and volumes ...

**************************************************************
 Geant4 version Name: geant4-10-04-patch-03    (8-February-2019)
                       Copyright : Geant4 Collaboration
                      References : NIM A 506 (2003), 250-303
                                 : IEEE-TNS 53 (2006), 270-278
                                 : NIM A 835 (2016), 186-225
                             WWW : http://geant4.org/
**************************************************************

<<< Geant4 Physics List simulation engine: FTFP_BERT 2.0

Found 69 volume(s) with auxiliary information.

Volume Shield_Cu_Side has the following list of auxiliary information: 

--> Type: Color Value: #ffaa0000
Volume Shield_Cu_Bottom has the following list of auxiliary information: 

--> Type: Color Value: #ffaa0000
Volume Plate_Cu_1 has the following list of auxiliary information: 

--> Type: Color Value: #ffaa0000
Volume Plate_Cu_2 has the following list of auxiliary information: 

--> Type: Color Value: #ffaa0000
Volume Plate_Cu_3 has the following list of auxiliary information: 

--> Type: Color Value: #ffaa0000
Volume Shield_Al_1_Side has the following list of auxiliary information: 

--> Type: Color Value: #81818100
Volume Shield_Al_1_Bottom has the following list of auxiliary information: 

--> Type: Color Value: #81818100
Volume Plate_Cu_004 has the following list of auxiliary information: 

--> Type: Color Value: #ffaa0000
Volume Shield_Al_2_Side has the following list of auxiliary information: 

--> Type: Color Value: #81818100
Volume Shield_Al_2_Bottom has the following list of auxiliary information: 

--> Type: Color Value: #81818100
Volume Plate_Al_1 has the following list of auxiliary information: 

--> Type: Color Value: #81818100
Volume Shield_Al_3_Side has the following list of auxiliary information: 

--> Type: Color Value: #81818100
Volume Shield_Al_3_Bottom has the following list of auxiliary information: 

--> Type: Color Value: #81818100
Volume Plate_Al_2 has the following list of auxiliary information: 

--> Type: Color Value: #81818100
Volume V-CLAMP007__Meshed_ has the following list of auxiliary information: 

--> Type: Color Value: #55000000
Volume V-SCREW020__Meshed_ has the following list of auxiliary information: 

--> Type: Color Value: #ccad3f00
Volume V-50mK_SAMPLE_HOLDER_NEW002__Meshed_ has the following list of auxiliary information: 

--> Type: Color Value: #ffaa7f00
Volume V-50mK_CRYOAC_HOLDER002__Meshed_ has the following list of auxiliary information: 

--> Type: Color Value: #00aaff00
Volume V-SCREW021__Meshed_ has the following list of auxiliary information: 

--> Type: Color Value: #ccad3f00
Volume V-CLAMP008__Meshed_ has the following list of auxiliary information: 

--> Type: Color Value: #55000000
Volume V-SCREW022__Meshed_ has the following list of auxiliary information: 

--> Type: Color Value: #ccad3f00
Volume V-SCREW023__Meshed_ has the following list of auxiliary information: 

--> Type: Color Value: #ccad3f00
Volume Sensitive_Detector_Top001 has the following list of auxiliary information: 

--> Type: Color Value: #ffff0000
--> Type: SensDet Value: Tracker
Volume V-SCREW024__Meshed_ has the following list of auxiliary information: 

--> Type: Color Value: #ccad3f00
Volume V-SCREW025__Meshed_ has the following list of auxiliary information: 

--> Type: Color Value: #ccad3f00
Volume V-SCREW026__Meshed_ has the following list of auxiliary information: 

--> Type: Color Value: #ccad3f00
Volume V-SCREW027__Meshed_ has the following list of auxiliary information: 

--> Type: Color Value: #ccad3f00
Volume V-piastramillefori001__Meshed_ has the following list of auxiliary information: 

--> Type: Color Value: #ffaa7f00
Volume V-staffa_squid001__Meshed_ has the following list of auxiliary information: 

--> Type: Color Value: #ffaa7f00
Volume V-Lamierino001__Meshed_ has the following list of auxiliary information: 

--> Type: Color Value: #ccccccff
Volume V-piastra_squid003__Meshed_ has the following list of auxiliary information: 

--> Type: Color Value: #ffaa7f00
Volume V-piastra_squid002__Meshed_ has the following list of auxiliary information: 

--> Type: Color Value: #ffaa7f00
Volume V-CLAMP007__Meshed_001 has the following list of auxiliary information: 

--> Type: Color Value: #55000000
Volume V-SCREW020__Meshed_001 has the following list of auxiliary information: 

--> Type: Color Value: #ccad3f00
Volume V-50mK_SAMPLE_HOLDER_NEW002__Meshed_001 has the following list of auxiliary information: 

--> Type: Color Value: #ffaa7f00
Volume V-50mK_CRYOAC_HOLDER002__Meshed_001 has the following list of auxiliary information: 

--> Type: Color Value: #00aaff00
Volume V-SCREW021__Meshed_001 has the following list of auxiliary information: 

--> Type: Color Value: #ccad3f00
Volume V-CLAMP008__Meshed_001 has the following list of auxiliary information: 

--> Type: Color Value: #55000000
Volume V-SCREW022__Meshed_001 has the following list of auxiliary information: 

--> Type: Color Value: #ccad3f00
Volume V-SCREW023__Meshed_001 has the following list of auxiliary information: 

--> Type: Color Value: #ccad3f00
Volume Sensitive_Detector_Top002 has the following list of auxiliary information: 

--> Type: Color Value: #ffff0000
Volume V-SCREW024__Meshed_001 has the following list of auxiliary information: 

--> Type: Color Value: #ccad3f00
Volume V-SCREW025__Meshed_001 has the following list of auxiliary information: 

--> Type: Color Value: #ccad3f00
Volume V-SCREW026__Meshed_001 has the following list of auxiliary information: 

--> Type: Color Value: #ccad3f00
Volume V-SCREW027__Meshed_001 has the following list of auxiliary information: 

--> Type: Color Value: #ccad3f00
Volume Cryophy_Side_Int001 has the following list of auxiliary information: 

--> Type: Color Value: #ffeeff00
Volume Cryophy_Bottom_Int001 has the following list of auxiliary information: 

--> Type: Color Value: #cccccc00
Volume Tube006 has the following list of auxiliary information: 

--> Type: Color Value: #ffeeff00
Volume Tube007 has the following list of auxiliary information: 

--> Type: Color Value: #ffeeff00
Volume Tube008 has the following list of auxiliary information: 

--> Type: Color Value: #ffeeff00
Volume Tube4_004 has the following list of auxiliary information: 

--> Type: Color Value: #ffeeff00
Volume Tube4_005 has the following list of auxiliary information: 

--> Type: Color Value: #ffeeff00
Volume Tube4_006 has the following list of auxiliary information: 

--> Type: Color Value: #ffeeff00
Volume Cryophy_Side_Ext001 has the following list of auxiliary information: 

--> Type: Color Value: #cccccc00
Volume Cryophy_Top_Ext001 has the following list of auxiliary information: 

--> Type: Color Value: #ffeeff00
Volume V-Lamella004 has the following list of auxiliary information: 

--> Type: Color Value: #ffeeff00
Volume V-Lamella005 has the following list of auxiliary information: 

--> Type: Color Value: #ffeeff00
Volume V-Lamella006 has the following list of auxiliary information: 

--> Type: Color Value: #ffeeff00
Volume Tube009 has the following list of auxiliary information: 

--> Type: Color Value: #ffeeff00
Volume VShell0 has the following list of auxiliary information: 

--> Type: Color Value: #55ffff00
Volume VShell10 has the following list of auxiliary information: 

--> Type: Color Value: #55ffff00
Volume VShell20 has the following list of auxiliary information: 

--> Type: Color Value: #55ffff00
Volume VShell30 has the following list of auxiliary information: 

--> Type: Color Value: #55ffff00
Volume VShell40 has the following list of auxiliary information: 

--> Type: Color Value: #55ffff00
Volume VShell50 has the following list of auxiliary information: 

--> Type: Color Value: #55ffff00
Volume VShell60 has the following list of auxiliary information: 

--> Type: Color Value: #55ffff00
Volume VShell70 has the following list of auxiliary information: 

--> Type: Color Value: #55ffff00
Volume VShell80 has the following list of auxiliary information: 

--> Type: Color Value: #55ffff00
Volume VShell90 has the following list of auxiliary information: 

--> Type: Color Value: #55ffff00

Volume Shield_Cu_Side has the following list of auxiliary information: 

Volume Shield_Cu_Bottom has the following list of auxiliary information: 

Volume Plate_Cu_1 has the following list of auxiliary information: 

Volume Plate_Cu_2 has the following list of auxiliary information: 

Volume Plate_Cu_3 has the following list of auxiliary information: 

Volume Shield_Al_1_Side has the following list of auxiliary information: 

Volume Shield_Al_1_Bottom has the following list of auxiliary information: 

Volume Plate_Cu_004 has the following list of auxiliary information: 

Volume Shield_Al_2_Side has the following list of auxiliary information: 

Volume Shield_Al_2_Bottom has the following list of auxiliary information: 

Volume Plate_Al_1 has the following list of auxiliary information: 

Volume Shield_Al_3_Side has the following list of auxiliary information: 

Volume Shield_Al_3_Bottom has the following list of auxiliary information: 

Volume Plate_Al_2 has the following list of auxiliary information: 

Volume V-CLAMP007__Meshed_ has the following list of auxiliary information: 

Volume V-SCREW020__Meshed_ has the following list of auxiliary information: 

Volume V-50mK_SAMPLE_HOLDER_NEW002__Meshed_ has the following list of auxiliary information: 

Volume V-50mK_CRYOAC_HOLDER002__Meshed_ has the following list of auxiliary information: 

Volume V-SCREW021__Meshed_ has the following list of auxiliary information: 

Volume V-CLAMP008__Meshed_ has the following list of auxiliary information: 

Volume V-SCREW022__Meshed_ has the following list of auxiliary information: 

Volume V-SCREW023__Meshed_ has the following list of auxiliary information: 

Volume Sensitive_Detector_Top001 has the following list of auxiliary information: 

********** Attaching sensitive detector Tracker to volume Sensitive_Detector_Top001

Volume V-SCREW024__Meshed_ has the following list of auxiliary information: 

Volume V-SCREW025__Meshed_ has the following list of auxiliary information: 

Volume V-SCREW026__Meshed_ has the following list of auxiliary information: 

Volume V-SCREW027__Meshed_ has the following list of auxiliary information: 

Volume V-piastramillefori001__Meshed_ has the following list of auxiliary information: 

Volume V-staffa_squid001__Meshed_ has the following list of auxiliary information: 

Volume V-Lamierino001__Meshed_ has the following list of auxiliary information: 

Volume V-piastra_squid003__Meshed_ has the following list of auxiliary information: 

Volume V-piastra_squid002__Meshed_ has the following list of auxiliary information: 

Volume V-CLAMP007__Meshed_001 has the following list of auxiliary information: 

Volume V-SCREW020__Meshed_001 has the following list of auxiliary information: 

Volume V-50mK_SAMPLE_HOLDER_NEW002__Meshed_001 has the following list of auxiliary information: 

Volume V-50mK_CRYOAC_HOLDER002__Meshed_001 has the following list of auxiliary information: 

Volume V-SCREW021__Meshed_001 has the following list of auxiliary information: 

Volume V-CLAMP008__Meshed_001 has the following list of auxiliary information: 

Volume V-SCREW022__Meshed_001 has the following list of auxiliary information: 

Volume V-SCREW023__Meshed_001 has the following list of auxiliary information: 

Volume Sensitive_Detector_Top002 has the following list of auxiliary information: 

Volume V-SCREW024__Meshed_001 has the following list of auxiliary information: 

Volume V-SCREW025__Meshed_001 has the following list of auxiliary information: 

Volume V-SCREW026__Meshed_001 has the following list of auxiliary information: 

Volume V-SCREW027__Meshed_001 has the following list of auxiliary information: 

Volume Cryophy_Side_Int001 has the following list of auxiliary information: 

Volume Cryophy_Bottom_Int001 has the following list of auxiliary information: 

Volume Tube006 has the following list of auxiliary information: 

Volume Tube007 has the following list of auxiliary information: 

Volume Tube008 has the following list of auxiliary information: 

Volume Tube4_004 has the following list of auxiliary information: 

Volume Tube4_005 has the following list of auxiliary information: 

Volume Tube4_006 has the following list of auxiliary information: 

Volume Cryophy_Side_Ext001 has the following list of auxiliary information: 

Volume Cryophy_Top_Ext001 has the following list of auxiliary information: 

Volume V-Lamella004 has the following list of auxiliary information: 

Volume V-Lamella005 has the following list of auxiliary information: 

Volume V-Lamella006 has the following list of auxiliary information: 

Volume Tube009 has the following list of auxiliary information: 

Volume VShell0 has the following list of auxiliary information: 

Volume VShell10 has the following list of auxiliary information: 

Volume VShell20 has the following list of auxiliary information: 

Volume VShell30 has the following list of auxiliary information: 

Volume VShell40 has the following list of auxiliary information: 

Volume VShell50 has the following list of auxiliary information: 

Volume VShell60 has the following list of auxiliary information: 

Volume VShell70 has the following list of auxiliary information: 

Volume VShell80 has the following list of auxiliary information: 

Volume VShell90 has the following list of auxiliary information: 


 FTFP_BERT : new threshold between BERT and FTFP is over the interval 
 for pions :   3 to 12 GeV
 for kaons :   3 to 12 GeV
 for proton :  3 to 12 GeV
 for neutron : 3 to 12 GeV

So why don’t I see my volumes from the output visualization files of the examples?

You haven’t provided any source code, so we have to guess what you’re doing. From the error message, it appears that you are reading in your GDML file, but incorrectly passing it to the Geant4 UI command processor.

Sorry, here are my codes.
athena.cc (3.5 KB)
GDMLDetectorConstruction.cc (4.5 KB)
GDMLDetectorConstruction.hh (473 Bytes)

   G4UIExecutive* ui = 0;
   if ( argc == 2 ) {
     ui = new G4UIExecutive(argc, argv);
   }

You’re passing the command line arguments to G4UIExecutive, which assumes that the first argument is a Geant4 macro (.mac) file.

Should it, in this way, take as the first argument my .gdml file and then run my macro as declared here (Athena.cc):

UI->ApplyCommand("/control/execute try.mac");     
      session->SessionStart();

?

Sorry, I understood now that I had to change in this way:

// Get the pointer to the User Interface manager
  //
  G4UImanager * UI = G4UImanager::GetUIpointer();  

  if (argc!=2)   // batch mode  
    {
     G4String command = "/control/execute ";
     G4String fileName = argv[2];
     UI->ApplyCommand(command+fileName);
    }
    
  else           // interactive mode : define visualization and UI terminal
    { 
#ifdef G4VIS_USE
      G4VisManager* visManager = new G4VisExecutive;
      visManager->Initialize();
#endif    
     
      G4UIsession * session = 0;
#ifdef G4UI_USE_TCSH
      session = new G4UIterminal(new G4UItcsh);      
#else
      session = new G4UIterminal();
#endif
      UI->ApplyCommand("/control/execute try.mac");     
      session->SessionStart();
      delete session;

However I still don’t know why the Heprep visualization does not see all the inner volumes of my gdml file, while loading the ROOT visualizer it seems all fine. These are the two views: