ade_editlockobjs

Land Desktop Development ARX CPP SDK

Up a level
ade_editlockobjs
 
 

Locks a set of objects and adds them to the save set.

ads_real

ade_editlockobjs

ads_name sel_set);

Returns the number of objects locked or ADE_REALFAIL.

sel_set The name of the selection set.

The function locks the objects contained in the designated selection set. Locking these objects adds them to the save set.

It is a good idea to compare the number of objects locked with the number of objects in the designated selection set. If the number locked is less than the number in the selection set, an error occurred in the locking process, and you should check the error stack.

The following sample creates a filtered selection set, adds its objects to a save set using ade_editlockobjs(), checks the result and displays information based on those results. The resbuf and selection set is then released as required.

struct resbuf* pFilteredEntitySelectionRb = acutBuildList(
                                                RTDXF0, "LWPOLYLINE",
                                                8, "UtilityNetwork-Electric",
                                                0);

ads_name ssObjsForSaveSet;
acedSSGet("X", NULL, NULL, pFilteredEntitySelectionRb, ssObjsForSaveSet);
long filteredEntitySelectionLength = 0;
acedSSLength(ssObjsForSaveSet, &filteredEntitySelectionLength;);

ads_real objsAddedToSaveSet = ade_editlockobjs(ssObjsForSaveSet);

if (filteredEntitySelectionLength == objsAddedToSaveSet) {
        acutPrintf(
            "\nThe number of selected entities, (%d)"
            "matches the number added to the save set."
            , filteredEntitySelectionLength);
}
else {
    acutPrintf(
        "\nThe number of selected entities, (%d)"
        "does not match the number added to the save set, (%d)."
        , filteredEntitySelectionLength, objsAddedToSaveSet);
}
acutRelRb(pFilteredEntitySelectionRb);
int resultCode = acedSSFree(ssObjsForSaveSet);