ade_odgettables

Land Desktop Development ARX CPP SDK

Up a level
ade_odgettables
 
 

Lists the tables attached to an object.

struct resbuf*

ade_odgettables(

ads_name ename);

Returns a list of table names (string) or NULL.

ename AutoCAD object name.

You must release the resbuf.

An object can have records of more than one table attached. This function lists all the tables that have records attached to the object. See ade_odaddrecord for information about records attached to objects.

An object can have more than one record from the same table attached. To find how many records of a given table are attached, use ade_odrecordqty.

The following sample creates a selection set of all entities in the current drawing using acedSSGet(). Each entity in the selection set is passed to ade_odgettables() with all required parameters, the results are stored in a resbuf and displayed. Then it releases the resbuf, as required.

struct resbuf* pOdTablesRb = NULL;
ads_name selectionSet;
ads_name ename;
acedSSGet("x", NULL, NULL, NULL, selectionSet);
long ssLength;
acedSSLength( selectionSet, &ssLength; );
for( int i = 0; i < ssLength; ++i )
{
    if( acedSSName(selectionSet, i, ename) == RTNORM )
    {
        pOdTablesRb = ade_odgettables(ename);
        struct resbuf* rb = pOdTablesRb;
        while(rb != NULL) {
            acutPrintf(
                "\nThe current entity has object data from %s attached: "
                , rb->resval.rstring);
            rb = rb->rbnext;
        }
    }
}
acutRelRb(pOdTablesRb);