Ejemplo n.º 1
0
        public static bool GetRootAssemblyPart(Tag partOccTag, out Part rootPart)
        {
            Tag[] tagArray;
            bool  flag;

            try
            {
                rootPart = null;
                CaxAsm.theUfSession.Assem.WhereIsPartUsed(partOccTag, out tagArray);
                if ((int)tagArray.Length != 0)
                {
                    CaxAsm.GetRootAssemblyPart(tagArray[0], out rootPart);
                    return(true);
                }
                else
                {
                    rootPart = (Part)NXObjectManager.Get(partOccTag);
                    flag     = true;
                }
            }
            catch (Exception exception)
            {
                rootPart = null;
                flag     = false;
            }
            return(flag);
        }