THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/01/2009 at 10:50, xxxxxxxx wrote:
Here is an example that browses through the entire object hierachy. Basically you browse with GetDown(), GetUp()and GetNext(), GetPrev(). Check with GetType for the object's type.
> \> Recursive(camera) \> { \> while(camera) \> { \> if(camera->GetType() == Ocamera) //check if it is a camera \> { \> //do something with camera \> println(camera->GetName()); //prints the name of the camera \> \> var parent = camera->GetUp(); \> if(parent) \> { \> //parent is the cameras parent \> //do something with parent \> println(parent->GetName()); //prints the name of the camera's parent \> } \> } \> \> Recursive(camera->GetDown()); \> \> camera = camera->GetNext(); \> } \> } \> \> main(doc,op) \> { \> Recursive(doc->GetFirstObject()); \> } \>
cheers,
Matthias