2006-02-24 01:57 AM - last edited on 2023-08-07 11:22 AM by Doreena Deng
ACAPI_Element_GetNum(API_TextID, &num); for(ii=1;ii<=num;++ii) { if(ACAPI_Element_Filter(API_TextID, ii, APIFilt_IsEditable)) { memset(&element, 0, sizeof(API_Element)); element.header.index = ii; element.header.typeID = API_TextID; err = ACAPI_Element_Get(&element); if(err == APIERR_BADINDEX) { // this is true when ii==num which should be a valid index, shouldn't it ? } }
2006-02-24 08:53 AM
adambutler wrote:The number returned by ACAPI_Element_Get is the highest index used in the database, which is not necessarily the number of elements in the database. The documentation states:
I've found on several drawings in ArchiCAD 9 an ACAPI_Element_Get returns APIERR_BADINDEX. Just wondering how this could happen? It doesn't happen in ArchiCAD 7.
Please note that the returned number does not necessarily match the number of existing elements of that type, as the ArchiCAD database may contain deleted elements as well; see the ACAPI_Element_Filter function for more details.
2006-02-27 01:59 AM