2 #--------------------------------------------------------------------------
3 # create AttributePixMap
4 #===============================
5 A = batchmode_geompy.myBuilder.FindOrCreateAttribute(batchmode_geompy.father, "AttributePixMap")
7 raise RuntimeError, "Can't create AttributePixMap attribute"
8 aPixmap = A._narrow(SALOMEDS.AttributePixMap);
9 aPixmap.SetPixMap( "ICON_OBJBROWSER_Geometry" );
11 if aPixmap.GetPixMap() != "ICON_OBJBROWSER_Geometry":
12 print "Error: wrong value of AttributePixMap"
15 # save / restore study
16 #============================================================
17 str= os.getenv("TmpDir")
20 file = str+"/test.hdf"
22 batchmode_geompy.myStudyManager.SaveAs(file, batchmode_geompy.myStudy)
23 openedStudy = batchmode_geompy.myStudyManager.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 AttributePixMap
34 #============================================================
36 res,A=father.FindAttribute("AttributePixMap")
37 if res == 0 or A == None:
38 raise RuntimeError, "Error: AttributePixMap not found "
40 A = A._narrow(SALOMEDS.AttributePixMap)
43 raise RuntimeError, "Can't create AttributePixMap attribute"
45 if A.GetPixMap() != "ICON_OBJBROWSER_Geometry":
46 print "Error: wrong value of AttributePixMap"