예제 #1
0
 private InvComponentOccurrences(Inventor.ComponentOccurrences invComponentOccurrences)
 {
     InternalComponentOccurrences = invComponentOccurrences;
     occurrenceList = new List <InvComponentOccurrence>();
     foreach (var occurrenceDef in InternalComponentOccurrences)
     {
         occurrenceList.Add(InvComponentOccurrence.ByInvComponentOccurrence((Inventor.ComponentOccurrence)occurrenceDef));
     }
 }
예제 #2
0
        private void GetTreeComponents(Inventor.ComponentOccurrences inCollection, TreeNode objparentNode) //uses BuildTree iterate components TO FINISH
        {
            //iterate through the components in the current collection
            IEnumerator assemblyEnumerator = inCollection.GetEnumerator();

            Inventor.ComponentOccurrence invCompOccurrence;

            while (assemblyEnumerator.MoveNext() == true)
            {
                invCompOccurrence = (Inventor.ComponentOccurrence)assemblyEnumerator.Current;
                int ImageType = 10;

                //determine if the current component is an assembly or part or iparts/iAssembly
                if (invCompOccurrence.IsiAssemblyMember || invCompOccurrence.IsiPartMember)
                {
                    if (invCompOccurrence.IsiAssemblyMember)
                    {
                        ImageType = 1;
                    }
                    else
                    {
                        ImageType = 3;
                    }
                }
                else
                {
                    if (invCompOccurrence.DefinitionDocumentType == Inventor.DocumentTypeEnum.kAssemblyDocumentObject)
                    {
                        ImageType = 0;
                    }
                    else
                    {
                        ImageType = 2;
                    }
                }
                TreeNode invCurrentNode = new TreeNode(invCompOccurrence.Name, ImageType, ImageType);
                invCurrentNode.Tag = invCompOccurrence.ReferencedDocumentDescriptor.ReferencedFileDescriptor.ReferencedFile.FullFileName;
                objparentNode.Nodes.Add(invCurrentNode);

                //recursively call this function for the suboccurrences of the current component
                GetTreeComponents((Inventor.ComponentOccurrences)invCompOccurrence.SubOccurrences, invCurrentNode);
                invCurrentNode.Expand();
            }
        }
예제 #3
0
 public static InvComponentOccurrences ByInvComponentOccurrences(Inventor.ComponentOccurrences invComponentOccurrences)
 {
     return(new InvComponentOccurrences(invComponentOccurrences));
 }