Salome HOME
Documenting of Python code
[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 modeler
7 from macros.box.feature import BoxFeature as MY
8
9
10 class Box(modeler.Interface):
11   """Executes the macro-feature Box.
12   """
13   def __init__(self, part, dx, dy, dz):
14     """Constructor"""
15     modeler.Interface.__init__(self, part, MY.ID())
16
17     self.setRealInput( MY.WIDTH_ID(), dx )
18     self.setRealInput( MY.LENGTH_ID(), dy )
19     self.setRealInput( MY.HEIGHT_ID(), dz )
20
21     if self.areInputValid():
22       self.execute()
23     else:
24       raise Exception("cannot make the Box")