how to use "OR" in acutBuildList object arx c++
- User
how to use "OR" in acutBuildList object arx c++
- Assistant
In ARX C++, you can use the
acutBuildListfunction to create a general-purpose AutoCAD entity selection set. To use the "OR" condition to filter your selection, you need to add the selection filters using theRDS(resurrect double space) code orDXFgroup code.Here's an example of how to use the "OR" condition in the
acutBuildListfunction:ads_name ss; acedSSGet(NULL, NULL, NULL, NULL, ss); // Prompt the user to select entities ads_name ent; int count; acedSSLength(ss, &count); // Get the number of entities selected struct resbuf *rb; rb = acutBuildList(RTDXF0, "LINE", // Filter for LINE entities RTDXF30, "<OR", // Start of OR condition block RTDXF0, "CIRCLE", // Filter for CIRCLE entities RTDXF30, ">", // End of OR condition block RTNONE); // Null-terminator for the list for (int i = 0; i < count; i++) { acedSSName(ss, i, ent); // Get the i-th entity from the selection set // Check if the entity matches the filter criteria using an OR condition if (acedEntGet(rb, ent) == RTNORM) { // Process the entity here } } acutRelRb(rb); // Release the resbuf memory acedSSFree(ss); // Release the selection set memory