コード例 #1
0
ファイル: CADComponent.cs プロジェクト: daoos/meta-core
        public CADComponent(CyPhy.Component cyphycomp, string ProjectDirectory, bool size2fit = false,
                            CyPhyCOMInterfaces.IMgaTraceability Traceability = null, CyPhyClasses.CADModel.AttributesClass.FileFormat_enum cadFormat = CyPhyClasses.CADModel.AttributesClass.FileFormat_enum.Creo)
        {
            Type = CADDataType.Component;
            StructuralInterfaceNodes = new Dictionary <string, StructuralInterfaceConstraint>();
            DisplayID            = cyphycomp.Attributes.InstanceGUID;
            Id                   = cyphycomp.ID;
            GraphvizID           = UtilityHelpers.CleanString2(cyphycomp.ID, 50, "-");
            AVMID                = cyphycomp.Attributes.AVMID;
            RevID                = "";
            VersionID            = cyphycomp.Attributes.Version;
            CADFormat            = cadFormat;
            Name                 = cyphycomp.Name;
            CadParameters        = new List <CADParameter>();
            ModelType            = "Part";
            Size2Fit             = size2fit;
            MaterialName         = "";
            CyPhyModelPath       = cyphycomp.GetDirectoryPath(ProjectDirectory: ProjectDirectory);
            Classification       = cyphycomp.Attributes.Classifications;
            HyperLink            = cyphycomp.ToHyperLink();
            CadElementsList      = new List <CAD.ElementType>();
            pointCoordinatesList = new List <TestBenchModel.TBComputation>();
            this.Traceability    = Traceability;

            CreateStructuralInterfaceEquivalent(cyphycomp);

            AddManufacturingParameters(cyphycomp);

            var specialinstr = cyphycomp.Children.ParameterCollection.Where(p => p.Name.ToUpper() == SpecialInstrParamStr);

            if (specialinstr.Any())
            {
                SpecialInstructions = specialinstr.First().Attributes.Value.Replace("\"", "");
            }

            // META-3555 hack
            if (cyphycomp.Children.CADModelCollection.Any())
            {
                foreach (var datum in cyphycomp.Children.CADModelCollection.First().Children.CADDatumCollection)
                {
                    if (datum.Name == "FRONT" || datum.Name == "TOP" || datum.Name == "RIGHT")
                    {
                        SpecialDatums.Add(new Datum(datum, "", false));
                    }
                }
            }

            foreach (var prop in cyphycomp.Children.PropertyCollection)
            {
                if (prop.Name.StartsWith("METADATA."))
                {
                    MetaData.Add(prop.Name.Substring(9), prop.Attributes.Value);
                }
            }

            TraverseComposites(cyphycomp);
            CreatePointCoordinatesList(cyphycomp);
        }
コード例 #2
0
ファイル: CADFlatDataCreator.cs プロジェクト: daoos/meta-core
        public CADFlatDataCreator(string outputdir, string projectDirectory, CyPhyClasses.CADModel.AttributesClass.FileFormat_enum cadFormat, bool metalink = false)
        {
            // messages = new List<Message>();
            regularComponents        = new Dictionary <string, DataRep.CADComponent>();
            size2fitComponents       = new Dictionary <string, DataRep.CADComponent>();
            regularEdges             = new List <DataRep.CADEdge>();
            size2fitEdges            = new List <DataRep.CADEdge>();
            orphans                  = new List <DataRep.CADComponent>();
            referenceCoordComponents = new List <string>();
            OutputDir                = outputdir;
            ProjectDirectory         = projectDirectory;
            this.cadFormat           = cadFormat;
            errorCnt                 = 0;
            warningCnt               = 0;
            MetaLink                 = metalink;

            structuralInfProcessed = new List <string>();
            GMEIDJointIDMap        = new Dictionary <string, string>();
        }