Tiles and tile maps

 From:  Michael Gibson
8663.42 In reply to 8663.41 
Hi Brian, there is an object.type but it gives it as a number code. Here's a helper function get_type that will return a string type:

code:
function get_type( obj )
{
    switch(obj.type)
    {
    case 1: return 'CurveSegment';
    case 2: return 'Curve';
    case 3: return 'BRep';
    case 4: return 'Face';
    case 5: return 'ConstructionLine';
    case 6: return 'PointObject';
    case 7: return 'MeshObject';
    
    case 0:
    default: return 'Unknown';
    }
}

var objs = moi.geometryDatabase.getObjects();
for ( var i = 0; i < objs.length; ++i )
{
    var obj = objs.item(i);
    moi.ui.alert( get_type(obj) );
}


- Michael