ade_dwgindex

Land Desktop Development ARX CPP SDK

Up a level
ade_dwgindex
 
 

Applies specified index operations to a drawing.

rtype

ade_dwgindex(

ade_id dwgID);

Returns RTNORM or an error code.

dwgID The drawing ID for the drawing on which index operations will be performed.

When you call ade_dwgindex, indexes in the specified drawing are created or removed in accordance with the current index operation definition created by one or more calls to ade_dwgindexdef. If there is no index operation definition, ade_dwgindex has no effect on the drawing and returns ADE_NULLID.

The following sample, first clears any existing index defenitions using ade_dwgindexdef() with an empty string, ("") for the indexType parameter. A location index and an object data index are then defined and executed against all active drawings in the current project using ade_dwgindex(). Resbufs are then released as required. For more samples, see Creating Index Operation Expressions.

char* pszIndexName = "";
struct resbuf* indexParams = acutBuildList(RTNIL, 0);
int resultCode = ade_dwgindexdef(
                    pszIndexName,// An empty string "" clears
                    0,// remove index
                    indexParams);

char* pszPropIndexName = "Location";
resultCode = ade_dwgindexdef(
                    pszPropIndexName,
                    1,
                    indexParams);

struct resbuf* pOdIndexParamsRb = acutBuildList(
                                    RTLB,
                                        RTLB,
                                            RTSTR, "RIBLKGRP",
                                            RTSTR, "AMERI_ES",
                                        RTLE,
                                        RTLB,
                                            RTSTR, "RIRDS",
                                        RTLE,

                                    RTLE,
                                    0);
char* pszOdIndexName = "ObjData";
resultCode = ade_dwgindexdef(
                    pszOdIndexName,
                    1,
                    pOdIndexParamsRb);

struct resbuf* pAttachedDwgsRb = ade_dslist(ADE_NULLID, ADE_FALSE);
if (NULL != pAttachedDwgsRb) {
    struct resbuf* rb = pAttachedDwgsRb;
    while(NULL != rb) {
        resultCode = ade_dwgindex(rb->resval.rreal);
        rb = rb->rbnext;
    }
}
else {
    acutPrintf(
        "\nThere are no attached drawings in this project.");
}
acutRelRb(indexParams);
acutRelRb(pAttachedDwgsRb);