Salome HOME
Merge branch 'python_parametric_api' of https://git.salome-platform.org/git/modules...
[modules/shaper.git] / src / PythonAPI / extension / box.py
1 """Box macro-feature Interface
2 Author: Daniel Brunier-Coulin
3 Copyright (C) 2014-20xx CEA/DEN, EDF R&D
4 """
5
6 import model
7 from macros.box.feature import BoxFeature as MY
8
9
10 class Box(model.Interface):
11   """Executes the macro-feature Box.
12   """
13   def __init__(self, part, dx, dy, dz):
14     model.Interface.__init__(self, part, MY.ID())
15
16     self.setRealInput( MY.WIDTH_ID(), dx )
17     self.setRealInput( MY.LENGTH_ID(), dy )
18     self.setRealInput( MY.HEIGHT_ID(), dz )
19
20     if self.areInputValid():
21       self.execute()
22     else:
23       raise Exception("cannot make the Box")