THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 06/05/2005 at 09:30, xxxxxxxx wrote:
Seems the only way to do this is to get your BaseDocument, go through the object hierarchy, and check each object for the tag (skipping the one that should contain the tag).
BaseDocument* doc = GetActiveDocument();
BaseObject* obj = doc->GetFirstObject();
BaseObject* myObj; // contains valid tag
void CheckFormyTag(obj, myObj);
void CheckFormyTag(BaseObject* obj, BaseObject* myObj)
{
for (obj; obj; obj = obj->GetNext())
{
CheckFormyTag(obj->GetDown(), myObj);
if (!obj->GetTag(ID_MYTAG_PLUGIN)) continue;
if (obj == myObj) continue;
// Otherwise, there is another of your tags on another object
...
}
}
ETA: You could temporarily remove the valid-tag object before doing this check and reinsert afterwards - making certain to retain its parent for proper reinsertion. Then you wouldn't need to send it through the recursive function and check each object against it.