Hi,
Is the following script what you had in mind?
import rhinoscriptsyntax as rs
def OpenProjectTest():
allLayers = rs.LayerNames()
print "allLayers before Open command: " + str(allLayers)
desigbBkpFilename = "P:\PREP_DECOUPE\BackupDesign.3dm"
rs.Command("_-Open " + desigbBkpFilename + " _Enter" )
allLayers = rs.LayerNames()
print "allLayers after Open command: " + str(allLayers)
rs.Command("_-Open " + desigbBkpFilename + " _Enter" )
allLayers = rs.LayerNames()
print "allLayers after second Open command: " + str(allLayers)
OpenProjectTest()
Running this small program from the Python code editor, we see everything works:
Output of this code shows its working as expected:
allLayers before Open command: ['Default', 'Layer 01', 'Layer 02', 'Layer 03', 'Layer 04', 'Layer 05']
allLayers after Open command: ['Default', 'STL', '104564D Podoscan', '0', '104564D_Contour_Data4941985', 'Metatarsal_1', 'Metatarsal_2', 'Metatarsal_3', 'Metatarsal_4', 'Metatarsal_5', 'AlignmentPoint_1', 'AlignmentPoint_2', 'AlignmentPoint_3', 'AlignmentPoint_4', 'AlignmentPoint_5', 'AxisLines', 'Forefoot_Contour', 'Medial_Edge', 'Lateral_Edge', '104564D_Contour_Data4941985::Heel_Contour']
allLayers after second Open command: ['Default', 'STL', '104564D Podoscan', '0', '104564D_Contour_Data4941985', 'Metatarsal_1', 'Metatarsal_2', 'Metatarsal_3', 'Metatarsal_4', 'Metatarsal_5', 'AlignmentPoint_1', 'AlignmentPoint_2', 'AlignmentPoint_3', 'AlignmentPoint_4', 'AlignmentPoint_5', 'AxisLines', 'Forefoot_Contour', 'Medial_Edge', 'Lateral_Edge', '104564D_Contour_Data4941985::Heel_Contour']
I already did this experiment before posting in the hope of pinpointing what went wrong in a smaller context but could not reproduce the problem I had in my bigger GUI module. Do you have any other ideas that I could test? Is there a way to get a view of the code for the Open command?
Thanks