コード例 #1
0
        private void doModel(IfcStore m)
        {
            string projName = m.Instances.FirstOrDefault <IIfcProject>().Name;
            string SqlStmt;
            string currStep = string.Empty;

            m.BeginCaching();

            try
            {
                // Insert model info
                SqlStmt = "Insert into " + DBOperation.formatTabName("BIMRL_ModelInfo") + " (ModelID, ModelName, Source) Values ("
                          + _ModelID + ",'" + projName + "','" + m.FileName + "')";
                currStep = SqlStmt;
                int status = DBOperation.insertRow(SqlStmt);

                // Process the owner history
                currStep = "Processing Owner History.";
                BIMRLOwnerHistory procOwnH = new BIMRLOwnerHistory(m, _bimrlCommon);
                procOwnH.processOwnerHistory();

                // Process all Ifc Type definitions
                currStep = "Processing IFC Type Objects.";
                BIMRLTypeObject bimrlTyp = new BIMRLTypeObject(m, _bimrlCommon);
                bimrlTyp.processTypeObject();

                // Process structure elements
                // processStructureElementData(m);
                currStep = "Processing Spatial Structure Elements.";
                BIMRLSpatialStructure spaStruc = new BIMRLSpatialStructure(m, _bimrlCommon);
                spaStruc.processElementStructure();

                // Process all IfcProduct for BIMRL_ELEMENT
                currStep = "Processing IFC Elements.";
                BIMRLElement procElem = new BIMRLElement(m, _bimrlCommon);
                procElem.processElements();

                currStep = "Processing All relationships.";
                // Process All relationships
                BIMRLRelationship procRel = new BIMRLRelationship(m, _bimrlCommon);
                procRel.processRelationships();

                currStep = "Processing Classifications.";
                // Process All Classifications
                BIMRLClassification procClassif = new BIMRLClassification(m, _bimrlCommon);
                procClassif.processClassificationItems();

                currStep = "Processing Materials.";
                // Process All Materials
                BIMRLMaterial procMat = new BIMRLMaterial(m, _bimrlCommon);
                procMat.processMaterials();
            }
            catch (SystemException e)
            {
                string excStr = "%%Error - " + e.Message + "\n\t" + currStep;
                _bimrlCommon.StackPushError(excStr);
                throw;
            }
            m.StopCaching();
        }