Beispiel #1
0
        static void PopulateDocumentItems(SolidEdgeAssembly.SubOccurrences subOccurrences, DocumentItem parentItem)
        {
            foreach (SolidEdgeAssembly.SubOccurrence subOccurrence in subOccurrences)
            {
                var occurrenceItem = new DocumentItem(subOccurrence);

                // Make sure the DocumentItem hasn't already been added.
                if (parentItem.DocumentItems.Contains(occurrenceItem) == false)
                {
                    parentItem.DocumentItems.Add(occurrenceItem);

                    if (subOccurrence.SubOccurrences != null)
                    {
                        PopulateDocumentItems(subOccurrence.SubOccurrences, occurrenceItem);
                    }
                }
            }
        }
Beispiel #2
0
        public BomItem(SolidEdgeAssembly.Occurrence occurrence, int level)
        {
            Level = level;
            FileName = System.IO.Path.GetFullPath(occurrence.OccurrenceFileName);
            IsMissing = occurrence.FileMissing();
            Quantity = 1;
            IsSubassembly = occurrence.Subassembly;

            // If the file exists, extract file properties.
            if (IsMissing == false)
            {
                var document = (SolidEdgeFramework.SolidEdgeDocument)occurrence.OccurrenceDocument;
                var summaryInfo = (SolidEdgeFramework.SummaryInfo)document.SummaryInfo;

                DocumentNumber = summaryInfo.DocumentNumber;
                Title = summaryInfo.Title;
                Revision = summaryInfo.RevisionNumber;
            }
        }
Beispiel #3
0
        static void PopulateBom(int level, SolidEdgeAssembly.AssemblyDocument assemblyDocument, BomItem parentBomItem)
        {
            // Increment level (depth).
            level++;

            // This sample BOM is not exploded. Define a dictionary to store unique occurrences.
            Dictionary<string, SolidEdgeAssembly.Occurrence> uniqueOccurrences = new Dictionary<string, SolidEdgeAssembly.Occurrence>();

            // Populate the unique occurrences dictionary.
            foreach (SolidEdgeAssembly.Occurrence occurrence in assemblyDocument.Occurrences)
            {
                // To make sure nothing silly happens with our dictionary key, force the file path to lowercase.
                var lowerFileName = occurrence.OccurrenceFileName.ToLower();

                // If the dictionary does not already contain the occurrence, add it.
                if (uniqueOccurrences.ContainsKey(lowerFileName) == false)
                {
                    uniqueOccurrences.Add(lowerFileName, occurrence);
                }
            }

            // Loop through the unique occurrences.
            foreach (SolidEdgeAssembly.Occurrence occurrence in uniqueOccurrences.Values.ToArray())
            {
                // Filter out certain occurrences.
                if (!occurrence.IncludeInBom) { continue; }
                if (occurrence.IsPatternItem) { continue; }
                if (occurrence.OccurrenceDocument == null) { continue; }

                // Create an instance of the child BomItem.
                var bomItem = new BomItem(occurrence, level);

                // Add the child BomItem to the parent.
                parentBomItem.Children.Add(bomItem);

                if (bomItem.IsSubassembly == true)
                {
                    // Sub Assembly. Recurisve call to drill down.
                    PopulateBom(level, (SolidEdgeAssembly.AssemblyDocument)occurrence.OccurrenceDocument, bomItem);
                }
            }
        }
Beispiel #4
0
        static void ReportRelation(SolidEdgeAssembly.TangentRelation3d relation3d, SolidEdgeFramework.ObjectType objectType)
        {
            Console.WriteLine("Index: {0} ({1})", relation3d.Index, objectType);

            try
            {
                Console.WriteLine("DetailedStatus: {0}", relation3d.DetailedStatus);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("HalfSpacePositive: {0}", relation3d.HalfSpacePositive);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("Offset: {0}", relation3d.Offset);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("RangedOffset: {0}", relation3d.RangedOffset);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("RangeHigh: {0}", relation3d.RangeHigh);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("RangeLow: {0}", relation3d.RangeLow);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("Status: {0}", relation3d.Status);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("Suppress: {0}", relation3d.Suppress);
            }
            catch
            {
            }

            Console.WriteLine();
        }
Beispiel #5
0
 public static void SaveAsJT(SolidEdgeAssembly.AssemblyDocument document)
 {
     SaveAsJT((SolidEdgeFramework.SolidEdgeDocument)document);
 }
Beispiel #6
0
 static void ReportItem(SolidEdgeAssembly.Occurrence occurrence)
 {
     Console.WriteLine("Name: {0}", occurrence.Name);
     Console.WriteLine("OccurrenceFileName: {0}", occurrence.OccurrenceFileName);
 }
Beispiel #7
0
 public DocumentItem(SolidEdgeAssembly.SubOccurrence subOccurrence)
     : this()
 {
     FileName = subOccurrence.SubOccurrenceFileName;
 }
Beispiel #8
0
        static void ReportRelation(SolidEdgeAssembly.AxialRelation3d relation3d, SolidEdgeFramework.ObjectType objectType)
        {
            Console.WriteLine("Index: {0} ({1})", relation3d.Index, objectType);

            try
            {
                Console.WriteLine("DetailedStatus: {0}", relation3d.DetailedStatus);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("FixedParallelOffset: {0}", relation3d.FixedParallelOffset);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("FixedRotate: {0}", relation3d.FixedRotate);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("Offset: {0}", relation3d.Offset);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("Orientation: {0}", relation3d.Orientation);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("ParallelOffset: {0}", relation3d.ParallelOffset);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("RangedOffset: {0}", relation3d.RangedOffset);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("RangeHigh: {0}", relation3d.RangeHigh);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("RangeLow: {0}", relation3d.RangeLow);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("Status: {0}", relation3d.Status);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("Suppress: {0}", relation3d.Suppress);
            }
            catch
            {
            }

            Console.WriteLine();
        }
 public static void ReportVariables(SolidEdgeAssembly.AssemblyDocument document)
 {
     ReportVariables((SolidEdgeFramework.SolidEdgeDocument)document);
 }
Beispiel #10
0
 public DocumentItem(SolidEdgeAssembly.Occurrence occurrence)
     : this()
 {
     FileName = occurrence.OccurrenceFileName;
 }
Beispiel #11
0
        static void ReportRelation(SolidEdgeAssembly.AngularRelation3d relation3d, SolidEdgeFramework.ObjectType objectType)
        {
            Console.WriteLine("Index: {0} ({1})", relation3d.Index, objectType);

            try
            {
                Console.WriteLine("Angle: {0}", relation3d.Angle);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("DetailedStatus: {0}", relation3d.DetailedStatus);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("RangedAngle: {0}", relation3d.RangedAngle);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("RangeHigh: {0}", relation3d.RangeHigh);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("RangeLow: {0}", relation3d.RangeLow);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("Status: {0}", relation3d.Status);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("Suppress: {0}", relation3d.Suppress);
            }
            catch
            {
            }

            Console.WriteLine();
        }
Beispiel #12
0
 void DoOpenSave(SolidEdgeAssembly.AssemblyDocument assemblyDocument, AssemblySettings assemblySettings)
 {
 }
Beispiel #13
0
        static void ReportRelation(SolidEdgeAssembly.SegmentTangentRelation3d relation3d, SolidEdgeFramework.ObjectType objectType)
        {
            Console.WriteLine("Index: {0} ({1})", relation3d.Index, objectType);

            try
            {
                Console.WriteLine("Status: {0}", relation3d.Status);
            }
            catch
            {
            }

            Console.WriteLine();
        }
Beispiel #14
0
        static void ReportRelation(SolidEdgeAssembly.SegmentAngularRelation3d relation3d, SolidEdgeFramework.ObjectType objectType)
        {
            Console.WriteLine("Index: {0} ({1})", relation3d.Index, objectType);

            try
            {
                Console.WriteLine("AngleCounterclockwise: {0}", relation3d.AngleCounterclockwise);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("AngleToPositiveDirection: {0}", relation3d.AngleToPositiveDirection);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("Status: {0}", relation3d.Status);
            }
            catch
            {
            }

            Console.WriteLine();
        }
Beispiel #15
0
        static void ReportRelation(SolidEdgeAssembly.RigidSetRelation3d relation3d, SolidEdgeFramework.ObjectType objectType)
        {
            Console.WriteLine("Index: {0} ({1})", relation3d.Index, objectType);

            try
            {
                Console.WriteLine("DetailedStatus: {0}", relation3d.DetailedStatus);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("OccurrenceCount: {0}", relation3d.OccurrenceCount);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("Status: {0}", relation3d.Status);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("Suppress: {0}", relation3d.Suppress);
            }
            catch
            {
            }

            Console.WriteLine();
        }
Beispiel #16
0
        static void ReportRelation(SolidEdgeAssembly.PlanarRelation3d relation3d, SolidEdgeFramework.ObjectType objectType)
        {
            Console.WriteLine("Index: {0} ({1})", relation3d.Index, objectType);

            try
            {
                Console.WriteLine("DetailedStatus: {0}", relation3d.DetailedStatus);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("FixedOffset: {0}", relation3d.FixedOffset);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("NormalsAligned: {0}", relation3d.NormalsAligned);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("Offset: {0}", relation3d.Offset);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("RangedOffset: {0}", relation3d.RangedOffset);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("RangeHigh: {0}", relation3d.RangeHigh);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("RangeLow: {0}", relation3d.RangeLow);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("Status: {0}", relation3d.Status);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("Suppress: {0}", relation3d.Suppress);
            }
            catch
            {
            }

            Console.WriteLine();
        }
Beispiel #17
0
        static void ReportRelation(SolidEdgeAssembly.GearRelation3d relation3d, SolidEdgeFramework.ObjectType objectType)
        {
            Console.WriteLine("Index: {0} ({1})", relation3d.Index, objectType);

            try
            {
                Console.WriteLine("DetailedStatus: {0}", relation3d.DetailedStatus);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("RatioValue1: {0}", relation3d.RatioValue1);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("RatioValue2: {0}", relation3d.RatioValue2);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("Status: {0}", relation3d.Status);
            }
            catch
            {
            }

            try
            {
                Console.WriteLine("Suppress: {0}", relation3d.Suppress);
            }
            catch
            {
            }

            Console.WriteLine();
        }