2 # create AttributeOpened
3 #===========================================================
4 A = batchmode_geompy.myBuilder.FindOrCreateAttribute(batchmode_geompy.father, "AttributeOpened")
6 raise RuntimeError, "Can't create AttributeOpened attribute"
7 A = A._narrow(SALOMEDS.AttributeOpened)
10 raise RuntimeError, "Can't create AttributeOpened attribute"
15 "Error: wrong value of AttributeOpened"
18 # save / restore study
19 #============================================================
20 str= os.getenv("TmpDir")
23 file = str+"/test.hdf"
25 batchmode_geompy.myStudyManager.SaveAs(file, batchmode_geompy.myStudy)
26 openedStudy=batchmode_geompy.myStudyManager.Open(file);
28 if openedStudy == None:
29 raise RuntimeError, "Can't open saved study!"
31 father = openedStudy.FindComponent("GEOM")
33 raise RuntimeError, "Geom component is not found! Wrong study is opened."
36 # find AttributeOpened
37 #============================================================
39 res,A=father.FindAttribute("AttributeOpened")
40 if res == 0 or A == None:
41 raise RuntimeError, "Error: not found AttributeOpened"
43 A = A._narrow(SALOMEDS.AttributeOpened)
46 raise RuntimeError, "Can't create AttributeOpened attribute"
49 "Error: wrong value of AttributeOpened"