2 import batchmode_salome
5 aStudy = batchmode_salome.myStudy
7 #Add new component 'User data'
8 aBuilder = aStudy.NewBuilder()
9 aComponent = aBuilder.NewComponent("User data")
10 anAttr = aBuilder.FindOrCreateAttribute(aComponent, "AttributeName")
11 anAttrName = anAttr._narrow(SALOMEDS.AttributeName)
12 anAttrName.SetValue("User data")
15 #Add a new case 'Case1' to the component 'User data'
16 aBuilder.AddDirectory("/User data/Case1")
18 #Set a study context to '/User data/Case1'
19 aStudy.SetContext("/User data/Case1")
21 #Print the current study context
22 print aStudy.GetContext()
24 #Add a sub directory 'aSubCase' to 'Case1' (under the current context)
25 aBuilder.AddDirectory("aSubCase")
28 #Add a new case 'Case2' to component 'User data'
29 aBuilder.AddDirectory("/User data/Case2")