2 # create AttributeSelectable
3 #===========================================================
4 A = batchmode_geompy.myBuilder.FindOrCreateAttribute(batchmode_geompy.father, "AttributeSelectable")
6 raise RuntimeError, "Can't create AttributeSelectable attribute"
7 A = A._narrow(SALOMEDS.AttributeSelectable)
10 raise RuntimeError, "Can't create AttributeSelectable attribute"
14 if A.IsSelectable() == 0:
15 "Error: wrong value of AttributeSelectable"
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 AttributeSelectable
37 #============================================================
39 res,A=father.FindAttribute("AttributeSelectable")
40 if res == 0 or A == None:
41 raise RuntimeError, "Error: not found AttributeSelectable"
43 A = A._narrow(SALOMEDS.AttributeSelectable)
46 raise RuntimeError, "Can't create AttributeSelectable attribute"
48 if A.IsSelectable() == 0:
49 "Error: wrong value of AttributeSelectable"