how to convert class ?

 
 
 
Posted by:SITT
Data created:25 May 2010

public List<IINode> GetXRefCamera ()
{
    List<IINode> RefCameras = new List<IINode>();            
    IINode MaxRootNode = MaxInterface.RootNode;
    for (int i = 0; i < MaxRootNode.XRefFileCount ; ++i)
    {
        IINode tempRootNode = MaxRootNode.GetXRefTree(i);
        for (int ti = 0; ti < tempRootNode.NumChildren; ++ti)
        {
            IINode tNode = tempRootNode.GetChildNode(ti);
            MessageBox.Show(tNode.SuperClassID.ToString());
            MessageBox.Show((tNode as CameraObject).ToString());
            if ((tNode as CameraObject) != null)
            {
                MessageBox.Show(tNode.Name);
                RefCameras.Add(tNode);
            }
        }
    }
    return RefCameras;
}

 

xref.chindrennode.superclass is baseobject,how to convert to carmera, or how to check  is camera ?

Are you sure its BaseObject and not BaseNode?

You need to use IINode.ObjRef and check its SuperClassID (or see if its ICameraObject).

Marsel Khadiyev (Software Developer, EPHERE Inc.)

Laughing thanks