Change mother volume

Hi~
I imported my model into GEANT4 using GDML file. My model consists about 1000 volumes except for world volume. Then I constructed a new volume by means of hard-coded programing(i.e., G4Sphere…). I want to set all the volumes in the gdml file(except world volume) as daughter volumes of this new volume. In other words, I want to change the mother volume of those cells from world volume to this new volume. Can anyone tell me how to achieve this?
I have tried
SetMotherLogical(G4LogicalVolume pMother) in G4VPhysicalVolume.hh file
and
AddDaughter(G4VPhysicalVolume
p) in G4LogicalVolume.hh file,
but it doesn’t work.
Can anyone help me?
Thank you very much.

jcren.

hello.
To change the solid which corresponds to any logical volume you need to use the G4LogicalVolume’s SetSolid method.
Regards,
John