I'm currently having problems with a plugin I'm working on regarding family picking -- or rather, family type comparison. The setup is like this:
I have a CRunObject* vector which I can add objects to through an action. With a condition I've set up, the user can specify an object type. The plugin iterates through the vector to see if any of the objects inside it match the type specified and then picks them. Here's how the code is laid out(non-bracket or comment lines are numbered for easier reference):
1. vector<CRunObject*> objects;
...
// The type of the object specified in Construct
2. CRunObjType* objType = params[0].GetObjectParam(pRuntime);
// Iterate through the vector and find objects of like type
3. vector<CRunObject*>::iterator i = objects.begin();
4. for ( ; i != objects.end(); i++)
{
5. if ((*i)->pType == objType)
{
6. pRuntime->SelectAll((*i)->pType);
7. pRuntime->SelectF((*i), (*i)->pType);
}
}
[/code:35a49waq]
If the given object type -- objType -- is a specific object, everything works fine. However, if you substitute the specific object for a family, the type check in line 5 always returns false, resulting in no objects being picked.
Is this a problem in the way I'm comparing the types of the two objects?