2 #--------------------------------------------------------------------------
3 # create AttributeTextColor
4 #===========================================================
5 import SALOMEDS_Attributes_idl
6 color = SALOMEDS_Attributes_idl._0_SALOMEDS.Color(234,345,231)
8 A = batchmode_geompy.myBuilder.FindOrCreateAttribute(batchmode_geompy.father, "AttributeTextColor")
11 raise RuntimeError, "Can't create AttributeTextColor attribute"
12 A = A._narrow(SALOMEDS.AttributeTextColor)
15 raise RuntimeError, "Can't create AttributeTextColor attribute"
21 if c.R != 234 or c.G != 345 or c.B != 231:
22 print("Error: wrong value of AttributeTextColor")
24 # save / restore study
25 #============================================================
26 str= os.getenv("TmpDir")
29 file = str+"/test.hdf"
31 batchmode_geompy.myStudy.SaveAs(file)
32 openedStudy = batchmode_geompy.myStudy.Open(file);
34 if openedStudy == None:
35 raise RuntimeError, "Can't open saved study!"
37 father = openedStudy.FindComponent("GEOM")
39 raise RuntimeError, "Geom component is not found! Wrong study is opened."
42 # find AttributeTextColor
43 #============================================================
45 res,A=father.FindAttribute("AttributeTextColor")
46 if res == 0 or A == None:
47 raise RuntimeError, "Error: not found AttributeTextColor"
49 A = A._narrow(SALOMEDS.AttributeTextColor)
52 raise RuntimeError, "Can't create AttributeTextColor attribute"
55 if c.R != 234 or c.G != 345 or c.B != 231:
56 print("Error: wrong value of AttributeTextColor")