function CreateRectangle( frame, width, height, radius )
{
var rect_factory = moi.command.createFactory( 'rectangle' );
rect_factory.setInput( 0, frame ); /* Coordinate frame with base point + x/y axes. */
/* Input 1 can contain a corner point instead of width/height */
rect_factory.setInput( 2, width );
rect_factory.setInput( 3, height );
rect_factory.setInput( 4, radius != 0.0 ); /* false = not rounded, true = rounded.
/* Input 5 can contain a point for the rounded corner to go through instead of numeric radius value */
rect_factory.setInput( 6, radius );
var result_list = rect_factory.calculate();
rect_factory.cancel();
if ( result_list.length == 0 )
return null;
return result_list.item(0);
}
function TestRectangle()
{
var frame = moi.vectorMath.createTopFrame();
var width = 5;
var height = 10;
var radius = 1;
var rect = CreateRectangle( frame, width, height, radius );
if ( rect )
{
moi.geometryDatabase.addObject( rect );
}
}
TestRectangle();

Image Attachments:
pipeR_pic.png