Exemplo n.º 1
0
        public void GenerateIfc4()
        {
            var settings = new GeneratorSettings
            {
                Structure  = DomainStructure.LoadIfc2X3(),
                OutputPath = "Xbim.Ifc4"
            };
            var schema = SchemaModel.Load(File.ReadAllText("IFC4_ADD2.exp"), "IFC4_ADD2");

            Generator.GenerateSchema(settings, schema);
        }
Exemplo n.º 2
0
        private static void Main(string[] args)
        {
            var prjPath = GetDirectory(Settings.OutputDir);
            var project = GetProject(prjPath);

            var rules   = new[] { Properties.Resources.IFC2X3_rules, Properties.Resources.IFC4_rules };
            var domains = new[] { DomainStructure.LoadIfc2X3(), DomainStructure.LoadIfc4Add1() };

            for (var i = 0; i < rules.Length; i++)
            {
                var data = rules[i];
                Settings.Structure = domains[i];
                var schema = new XmlSerializer(typeof(SchemaRules)).Deserialize(new StringReader(data)) as SchemaRules;
                ProcessSchema(schema, project);
            }
            project.Save();
            Console.Beep(400, 1000);
        }
Exemplo n.º 3
0
        private static DomainStructure GetDomain(SchemaDefinition schema)
        {
            switch (schema.Source)
            {
            case SchemaSources.IFC2x3_TC1:
                return(DomainStructure.LoadIfc2X3());

            case SchemaSources.IFC4:
                return(DomainStructure.LoadIfc4());

            case SchemaSources.IFC4_ADD1:
                return(DomainStructure.LoadIfc4Add1());

            case SchemaSources.IFC4_ADD2:
                return(DomainStructure.LoadIfc4Add2());

            case SchemaSources.IFC4X1_FINAL:
                return(DomainStructure.LoadIfc4x1());

            default:
                return(null);
            }
        }
Exemplo n.º 4
0
        private static void Main()
        {
            var watch = Stopwatch.StartNew();

            //set working directory
            Environment.CurrentDirectory = @"c:\Users\Martin\Source\Repos\XbimEssentials";

            //prepare all schemas
            var ifc2X3        = LoadIfc2x3();
            var ifc2X3Domains = DomainStructure.LoadIfc2X3();

            EnhanceNullStyleInIfc(ifc2X3, ifc2X3Domains);

            var ifc4        = LoadIfc4Add2WithAlignmentExtension();
            var ifc4Domains = DomainStructure.LoadIfc4x1();

            EnhanceNullStyleInIfc(ifc4, ifc4Domains);
            //Move enums into Interfaces namespace in IFC4
            MoveEnumsToInterfaces(ifc4Domains, ifc4, Environment.CurrentDirectory, "Xbim.Ifc4");


            var ifc4x3        = LoadIfc4x3_RC2();
            var ifc4x3Domains = DomainStructure.LoadIfc4x3_RC2();

            EnhanceNullStyleInIfc(ifc4x3, ifc4x3Domains);
            FixEnumerationSelect(ifc4x3, ifc4x3Domains);


            var settings = new GeneratorSettings
            {
                Structure  = ifc2X3Domains,
                OutputPath = "Xbim.Ifc2x3",
                IgnoreDerivedAttributes = GetIgnoreDerivedAttributes(),
                GenerateInterfaces      = false
            };

            // Generator.GenerateSchema(settings, ifc2X3);
            // Console.WriteLine(@"IFC2x3 without interfaces generated");
            //
            // //generate cross schema access
            // settings.CrossAccessProjectPath = "Xbim.Ifc4";
            // settings.CrossAccessStructure = ifc4Domains;
            // settings.SchemaInterfacesNamespace = "Interfaces";
            // Generator.GenerateCrossAccess(settings, ifc2X3, ifc4);
            // Console.WriteLine(@"IFC4 interface access generated for IFC2x3");
            //
            settings.Structure                 = ifc4Domains;
            settings.OutputPath                = "Xbim.Ifc4";
            settings.GenerateInterfaces        = true;
            settings.SchemaInterfacesNamespace = "Xbim.Ifc4.Interfaces";
            Generator.GenerateSchema(settings, ifc4);
            Console.WriteLine(@"IFC4 with interfaces generated");

            settings.Structure          = ifc4x3Domains;
            settings.OutputPath         = "Xbim.Ifc4x3";
            settings.GenerateInterfaces = false;
            Generator.GenerateSchema(settings, ifc4x3);
            Console.WriteLine(@"IFC4x3 RC2 without interfaces generated");

            //generate cross schema access
            settings.CrossAccessProjectPath    = "Xbim.Ifc4";
            settings.CrossAccessStructure      = ifc4Domains;
            settings.SchemaInterfacesNamespace = "Interfaces";
            Generator.GenerateCrossAccess(settings, ifc4x3, ifc4);
            Console.WriteLine(@"IFC4 interface access generated for IFC 4x3");

            // PrintNewRepresentationTypes(ifc4x3, ifc4);

            watch.Stop();
            Console.WriteLine(@"Finished in {0}s.", watch.ElapsedMilliseconds / 1000);
            Console.Beep(440, 500);
            Console.ReadKey();
        }