THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 17/03/2003 at 21:46, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 8.012
Platform: Windows ;
Language(s) : C++ ;
---------
So far, the best approach that I can think of is to get each Array from the SelectionTags' BaseSelects and combine them into a buffer large enough for both then use FromArray to set that (into the first - the first being used as a collector for any duplicates), but it doesn't seem to be working:
if (stag->GetName() == stag2->GetName())
{
BaseSelect* bSelect1 = stag->GetBaseSelect();
BaseSelect* bSelect2 = stag2->GetBaseSelect();
if ((bSelect1 == NULL) || (bSelect2 == NULL)) throw ErrorException(ERROR_MODELINGCOMMAND, "Combine Selections");
LONG count1 = bSelect1->GetCount();
LONG count2 = bSelect2->GetCount();
UCHAR* combined, *off;
if ((combined = (UCHAR* )GeAlloc(count1 + count2)) == NULL) throw ErrorException(ERROR_MEMORY, NULL);
UCHAR* array1 = bSelect1->ToArray(count1);
UCHAR* array2 = bSelect2->ToArray(count2);
if ((array1 == NULL) || (array2 == NULL)) throw ErrorException(ERROR_MODELINGCOMMAND, "Combine Selections");
CopyMem(array1, combined, count1);
off = combined+count1;
CopyMem(array2, off, count2);
bSelect1->FromArray(combined, count1+count2);
//GeFree(combined);
GeFree(array1);
GeFree(array2);
stag2->Remove();
}
Not sure if this is the expected way to move do this.
Thanks,
Robert