Acad::ErrorStatus selectEntityInLayer(const char* nLayerName,AcDbObjectIdArray& nIDs) { Acad::ErrorStatus es = Acad::eOk; ads_name ents; struct resbuf *rb; rb=acutNewRb(AcDb::kDxfLayerName); rb->restype=8; rb->resval.rstring=(char*)nLayerName; rb->rbnext=NULL; acedSSGet("X",NULL,NULL,rb,ents); long entNums=0; acedSSLength(ents,&entNums); if (entNums == 0) es = Acad::eInvalidInput; else { for (long a = 0; a < entNums ; a ++) { AcDbObjectId objId; ads_name ent; acedSSName(ents,a,ent); acdbGetObjectId(objId, ent); nIDs.append(objId); } } acedSSFree(ents); acutRelRb(rb); return es; }