ade_dslist

Land Desktop Development ARX CPP SDK

Up a level
ade_dslist
 
 

Lists the drawings attached to a specified drawing.

struct resbuf*

ade_dslist(

ade_id dwg_id,

ade_boolean nested);

Returns a list of drawing IDs or NULL.

dwg_id The drawing ID or ADE_NULLID.
nested Drawing is nested or not. Values can be: ADE_TRUE or ADE_FALSE.

If the dwg_id argument is ADE_NULLID, this function returns drawing IDs for the drawings attached to the current drawing.

If the nested argument is ADE_TRUE, the list includes drawings that are directly attached and all nested drawings at every level below them. If the argument is ADE_FALSE, the list includes only drawings that are directly attached.

You must release the resbuf.

The following sample parses the resbuf returned by ade_dslist() and prints a list of attached drawing ID's. Then it releases the resbuf, as required.

struct resbuf* pAttachedDwgsRb = NULL;
pAttachedDwgsRb = ade_dslist(ADE_NULLID, 1);
if (NULL != pAttachedDwgsRb) {
    int nDwg = 0;
    struct resbuf* rb = pAttachedDwgsRb;
    while(rb != NULL) {
        ++nDwg;
        acutPrintf(
            "\nAttached drawing # %d has the ID of: %.0lf"
            ,nDwg, rb->resval.rreal);
        rb = rb->rbnext;
    }
}
else {
    acutPrintf(
        "\nThere are no attached drawings in this project.");
}
acutRelRb(pAttachedDwgsRb);