6import isystem.connect
as ic
10 connMgr = ic.ConnectionMgr()
11 connConfig = ic.CConnectionConfig().start_existing()
12 connMgr.connect(connConfig)
14 wksCtrl = ic.CWorkspaceController(connMgr)
21 wksFilePath = ic.CIDEController(connMgr).getPath(ic.CIDEController.WORKSPACE_FILE_NAME)
23 raise Exception(f
'There is no workspace opened. Please open some workspace before running this sample.')
25 print(f
"Unconditionally closing current workspace: {wksFilePath}")
26 wksCtrl.closeDiscard()
28 print(
"Reopening original workspace...")
29 wksCtrl.open(wksFilePath)
31 print(
"Closing workspace, without discarding any unsaved changes (no changes were made)...")
34 print(
"Reopening original workspace...")
35 wksCtrl.open(wksFilePath)
38if __name__ ==
"__main__":