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