THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 07/08/2012 at 02:03, xxxxxxxx wrote:
Originally posted by xxxxxxxx
Wouldn't that require an instance of the actual object/tag so that we can obtain the description?
Yes, but that's not a big deal because the object doesn't need to be present in a document but in memory. Here's an handy function that returns the name of an object's parameter:
String GetObjectParameterName(LONG type, LONG id)
{
BaseObject *op = BaseObject::Alloc(type);
if (op->GetType()==type)
{
AutoAlloc<Description> desc; if (!desc) return String();
if (!op->GetDescription(desc,DESCFLAGS_DESC_0)) return String();
const BaseContainer *bc = desc->GetParameterI(id,NULL);
if (bc)
return bc->GetString(DESC_NAME);
}
return String();
}
So for PRIM_CUBE_LEN we would call it like this:
GetObjectParameterName(Ocube, PRIM_CUBE_LEN)