1 # Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
26 #import SALOMEDS_Attributes_idl
29 # ===============================================================
31 # creating new object ===========================================
32 obj = geompy.myBuilder.NewObject(geompy.father)
34 # adding Name attribute =========================================
35 A1 = geompy.myBuilder.FindOrCreateAttribute(obj,"AttributeName")
36 name = A1._narrow(SALOMEDS.AttributeName)
37 name.SetValue("First Object")
39 # adding Comment attribute ======================================
40 A2 = geompy.myBuilder.FindOrCreateAttribute(obj,"AttributeComment")
41 comment = A2._narrow(SALOMEDS.AttributeComment)
42 comment.SetValue("This is Comment attribute")
44 # adding IOR attribute ==========================================
45 #A3 = geompy.myBuilder.FindOrCreateAttribute(obj,"AttributeIOR")
48 # adding integer attribute ======================================
49 A4 = geompy.myBuilder.FindOrCreateAttribute(obj,"AttributeInteger")
50 integer = A4._narrow(SALOMEDS.AttributeInteger)
53 # adding real attribute =========================================
54 A5 = geompy.myBuilder.FindOrCreateAttribute(obj,"AttributeReal")
55 real = A5._narrow(SALOMEDS.AttributeReal)
58 # adding sequence of integer attribute ==========================
59 A6 = geompy.myBuilder.FindOrCreateAttribute(obj,"AttributeSequenceOfInteger")
60 intseq = A6._narrow(SALOMEDS.AttributeSequenceOfInteger)
66 # adding sequence of real attribute =============================
67 A7 = geompy.myBuilder.FindOrCreateAttribute(obj,"AttributeSequenceOfReal")
68 realseq = A7._narrow(SALOMEDS.AttributeSequenceOfReal)
73 # adding PersistentRef attribute ================================
74 #A8 = geompy.myBuilder.FindOrCreateAttribute(obj,"AttributePersistentRef")
77 # adding Drawable attribute =====================================
78 A9 = geompy.myBuilder.FindOrCreateAttribute(obj,"AttributeDrawable")
79 drawable = A9._narrow(SALOMEDS.AttributeDrawable)
80 drawable.SetDrawable(1)
82 # adding Selectable attribute ===================================
83 #A10 = geompy.myBuilder.FindOrCreateAttribute(obj,"AttributeSelectable")
86 # adding Expandable attribute ===================================
87 #A11 = geompy.myBuilder.FindOrCreateAttribute(obj,"AttributeExpandable")
90 # adding Opened attribute =======================================
91 #A12 = geompy.myBuilder.FindOrCreateAttribute(obj,"AttributeOpened")
94 # adding TextColor attribute ====================================
95 A13 = geompy.myBuilder.FindOrCreateAttribute(obj,"AttributeTextColor")
96 textcolor = A13._narrow(SALOMEDS.AttributeTextColor)
100 # adding TextHighlightColor of real attribute ===================
101 #A14 = geompy.myBuilder.FindOrCreateAttribute(obj,"AttributeTextHighlightColor")
104 # adding PixMap of real attribute ===============================
105 #A15 = geompy.myBuilder.FindOrCreateAttribute(obj,"AttributePixMap")
108 # opening OCAF Browser ==========================================
109 # result = salome.myStudy.OCAFBrowser()