2 #--------------------------------------------------------------------------
3 # create AttributeTextHighlightColor
4 #===========================================================
6 import SALOMEDS_Attributes_idl
7 highlightcolor=SALOMEDS_Attributes_idl._0_SALOMEDS.Color(256,256,256)
9 A = batchmode_geompy.myBuilder.FindOrCreateAttribute(batchmode_geompy.father, "AttributeTextHighlightColor")
12 raise RuntimeError, "Can't create AttributeTextHighlightColor attribute"
13 A = A._narrow(SALOMEDS.AttributeTextHighlightColor)
16 raise RuntimeError, "Can't create AttributeTextHighlightColor attribute"
18 A.SetTextHighlightColor(highlightcolor)
20 c = A.TextHighlightColor();
21 if c.R != 256 or c.G != 256 or c.B != 256:
22 print("Error: wrong value of AttributeTextHighlightColor")
25 # save / restore study
26 #============================================================
27 str= os.getenv("TmpDir")
30 file = str+"/test.hdf"
32 batchmode_geompy.myStudy.SaveAs(file)
33 openedStudy=batchmode_geompy.myStudy.Open(file);
35 if openedStudy == None:
36 raise RuntimeError, "Can't open saved study!"
38 father = openedStudy.FindComponent("GEOM")
40 raise RuntimeError, "Geom component is not found! Wrong study is opened."
43 # find AttributeTextHighlightColor
44 #============================================================
46 res, A = father.FindAttribute("AttributeTextHighlightColor")
48 if res == 0 or A == None:
49 raise RuntimeError, "Error: not found AttributeTextHighlightColor"
51 A = A._narrow(SALOMEDS.AttributeTextHighlightColor)
54 raise RuntimeError, "Can't create AttributeTextHighlightColor attribute"
56 c = A.TextHighlightColor();
58 if c.R != 256 or c.G != 256 or c.B != 256:
59 print("Error: wrong value of AttributeTextTextHighlightColor")