--- /dev/null
+# -*- coding: utf-8 -*-
+
+import sys
+import salome
+
+salome.salome_init()
+theStudy = salome.myStudy
+
+from HYDROPy import *
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
+
+hydro_doc.SetLocalCS( 0, 0 )
+
+Polyline_1 = hydro_doc.CreateObject( KIND_POLYLINEXY )
+Polyline_1.SetName( "Polyline_1" )
+
+Polyline_1.SetZLevel( 0 )
+
+Polyline_1.SetWireColor( QColor( 0, 0, 0, 255 ) )
+
+Polyline_1.AddSection( "Section_1", 1, 1 )
+Polyline_1.AddPoint( 0, gp_XY( -293.23, 276.54 ) )
+Polyline_1.AddPoint( 0, gp_XY( -270.98, 163.29 ) )
+Polyline_1.AddPoint( 0, gp_XY( -207.28, 251.26 ) )
+Polyline_1.AddPoint( 0, gp_XY( -158.75, 160.26 ) )
+Polyline_1.AddPoint( 0, gp_XY( -109.20, 131.95 ) )
+Polyline_1.AddPoint( 0, gp_XY( -59.66, 126.90 ) )
+Polyline_1.AddPoint( 0, gp_XY( -54.60, 187.56 ) )
+Polyline_1.AddPoint( 0, gp_XY( -82.91, 220.93 ) )
+Polyline_1.AddPoint( 0, gp_XY( 76.84, 251.27 ) )
+Polyline_1.AddPoint( 0, gp_XY( -60.67, 285.65 ) )
+Polyline_1.AddPoint( 0, gp_XY( -73.81, 330.13 ) )
+
+Polyline_1.Update()
+
+
+
+if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser(1)
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import sys
+import salome
+
+salome.salome_init()
+theStudy = salome.myStudy
+
+from HYDROPy import *
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
+
+hydro_doc.SetLocalCS( 0, 0 )
+
+Polyline_1 = hydro_doc.CreateObject( KIND_POLYLINEXY )
+Polyline_1.SetName( "Polyline_1" )
+
+Polyline_1.SetZLevel( 0 )
+
+Polyline_1.AddSection( "Section_1", 1, 1 )
+Polyline_1.AddPoint( 0, gp_XY( -123.36, 57.13 ) )
+Polyline_1.AddPoint( 0, gp_XY( -74.82, 122.85 ) )
+Polyline_1.AddPoint( 0, gp_XY( -2.02, 179.47 ) )
+Polyline_1.AddPoint( 0, gp_XY( 79.88, 98.58 ) )
+Polyline_1.AddPoint( 0, gp_XY( 138.52, 23.76 ) )
+Polyline_1.AddPoint( 0, gp_XY( 30.33, -27.81 ) )
+Polyline_1.AddPoint( 0, gp_XY( -21.23, -101.62 ) )
+Polyline_1.AddPoint( 0, gp_XY( -48.53, 7.58 ) )
+Polyline_1.AddPoint( 0, gp_XY( -121.33, -13.65 ) )
+Polyline_1.AddPoint( 0, gp_XY( -288.17, 86.45 ) )
+
+Polyline_1.Update()
+
+
+Immersible_zone_1 = hydro_doc.CreateObject( KIND_IMMERSIBLE_ZONE )
+Immersible_zone_1.SetName( "Immersible zone_1" )
+
+Immersible_zone_1.SetZLevel( 1 )
+
+Immersible_zone_1.SetPolyline( Polyline_1 )
+
+Immersible_zone_1.Update()
+
+
+# Calculation case
+Case_1 = hydro_doc.CreateObject( KIND_CALCULATION )
+Case_1.SetName( "Case_1" )
+
+Case_1.SetAssignmentMode( HYDROData_CalculationCase.AUTOMATIC )
+Case_1.SetAssignmentLandCoverMode( HYDROData_CalculationCase.AUTOMATIC )
+Case_1.AddGeometryObject( Immersible_zone_1 )
+
+Case_1.SetBoundaryPolyline( Polyline_1 )
+
+# Start the algorithm of the partition and assignment
+Case_1.Update()
+
+# Export of the calculation case
+Case_1_entry = Case_1.Export( theStudy._get_StudyId() )
+
+# Get geometry shape and print debug information
+import GEOM
+from salome.geom import geomBuilder
+import math
+import SALOMEDS
+
+geompy = geomBuilder.New(theStudy)
+
+print "Entry:", Case_1_entry
+Case_1_geom = salome.IDToObject( str( Case_1_entry ) )
+print "Geom shape:", Case_1_geom
+print "Geom shape name:", Case_1_geom.GetName()
+
+props = geompy.BasicProperties(Case_1_geom)
+print " Wires length: ", props[0]
+print " Surface area: ", props[1]
+print " Volume : ", props[2]
+refLength = 1218.7373973
+refArea = 49697.2117918
+deltaLength = 2.0*abs((props[0] - refLength)/(props[0] + refLength))
+deltaArea = 2.0*abs((props[1] - refArea)/(props[1] + refArea))
+if deltaLength > 1e-7 or deltaArea > 1e-7 or props[2] != 0:
+ print "While must be:"
+ print " Wires length: ", refLength
+ print " Surface area: ", refArea
+ print " Volume : ", 0.
+ raise ValueError("Bad length or area")
+
+if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser(1)