A thousand Thanks, Alexey
However, I found an error when measuring perimeter3D when base units are set to foot (EPSG code 9002). I have a polyline shape 1 whose measurement with context menu Measure is correct 5.965 ft. However when I type shape.perimeter3D() in console I get incorrect value 1.818 (which corresponds to meters unit). Please see attachment....