lenght of a curve

 From:  noskule
5205.3 
cool, so I try show the number on the ui but I get an error, do you see whats wrong? And whats the catch(e) for, is it needed?

script:/* Calculate length of selected curves and copy to the clipboard as text */ var crvs = moi.geometryDatabase.getSelectedObjects().getCurves(); var len = 0.0; for ( var i = 0; i < crvs.length; ++i ) len += crvs.item(i).getLength(); moi.copyTextToClipboard( len ); if ( !window["_crvdistlabel"] ) { document.body.insertAdjacentHTML( "beforeEnd", "
" ); } _crvdistlabel.innerText = len.toFixed(4);', 250 ); } catch(e) {}