2 from batchmode_geompy import *
5 #--------------------------------------------------------------------------
6 # create AttributeDrawable
7 #===========================================================
8 A = batchmode_geompy.myBuilder.FindOrCreateAttribute(batchmode_geompy.father, "AttributeDrawable")
10 raise RuntimeError, "Can't create AttributeDrawable attribute"
11 A = A._narrow(SALOMEDS.AttributeDrawable)
14 raise RuntimeError, "Can't create AttributeDrawable attribute"
18 if A.IsDrawable() == 0:
19 "Error: wrong value of AttributeDrawable"
22 # save / restore study
23 #============================================================
24 str= os.getenv("TmpDir")
27 file = str+"/test.hdf"
29 batchmode_geompy.myStudyManager.SaveAs(file, batchmode_geompy.myStudy)
30 openedStudy=batchmode_geompy.myStudyManager.Open(file);
32 if openedStudy == None:
33 raise RuntimeError, "Can't open saved study!"
35 father = openedStudy.FindComponent("GEOM")
37 raise RuntimeError, "Geom component is not found! Wrong study is opened."
40 # find AttributeDrawable
41 #============================================================
43 res,A=father.FindAttribute("AttributeDrawable")
44 if res == 0 or A == None:
45 raise RuntimeError, "Error: not found AttributeDrawable"
47 A = A._narrow(SALOMEDS.AttributeDrawable)
50 raise RuntimeError, "Can't create AttributeDrawable attribute"
52 if A.IsDrawable() == 0:
53 "Error: wrong value of AttributeDrawable"