예제 #1
0
        /// <summary>
        /// Create Xml from a PipeScheduleType
        /// </summary>
        /// <param name="pipeScheduleType"></param>
        /// <returns></returns>
        private static XElement CreateXmlFromPipeScheduleType(PipeScheduleType pipeScheduleType)
        {
            XElement xPipeSchedule = new XElement(XName.Get("PipeScheduleType"));

            xPipeSchedule.Add(new XAttribute(XName.Get("name"), pipeScheduleType.Name));
            return(xPipeSchedule);
        }
예제 #2
0
        public static void LoadAllData()
        {
            OpenExcelApp(resourcesPath);
            //load data from excel file if it's not already loaded
            //loading fixtures flow
            if (fixturesFlow == null)
            {
                LoadFromExcel(1);
            }
            //loading materials
            if (materials == null)
            {
                materials = LoadMaterialsFromExcel();
            }
            if (pipeTypes == null)
            {
                LoadBimitPipeTypes();
            }
            //initializing vars
            calculationsSchedule = PipeScheduleType.Create(doc, string.Concat(calculatedSystem.Name, DateTime.Now.ToString("yyyyMMddHHmmss")));
            List <string> matNames = new List <string>(materials.Keys);

            segments = new Dictionary <string, PipeSegment>();
            //creating this here so it doesn't get created multiple times
            FilteredElementCollector materialElementCollector = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Materials);

            foreach (string matName in matNames)
            {
                ElementId matId;
                var       existingMat = materialElementCollector.FirstOrDefault(x => string.Compare(x.Name, matName.Remove(0, 5), true) == 0);
                if (null == existingMat)
                {
                    matId = Material.Create(doc, matName.Remove(0, 5));
                }
                else
                {
                    matId = existingMat.Id;
                }

                /*else
                 *  matId = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Materials).FirstOrDefault(x => x.Name == matName).Id;*/
                /*FamilySymbol newPipeType = CreateNewPipeType(standardPipeType, matName, matId);
                 * pipeTypes.Add(newPipeType);*/
                Values         defaultSize = materials[matName][0];
                double         nd          = (defaultSize.intd + defaultSize.extd) / 2;
                MEPSize        size        = new MEPSize(nd / 304.8, defaultSize.intd / 304.8, defaultSize.extd / 304.8, true, true);
                List <MEPSize> sizes       = new List <MEPSize>();
                sizes.Add(size);
                PipeSegment seg = PipeSegment.Create(doc, matId, calculationsSchedule.Id, sizes);
                segments.Add(matName, seg);
            }

            CloseExcelApp();
            dataIsExtracted = true;
        }
예제 #3
0
        private void Stream(ArrayList data, PipeScheduleType pipeSchedType)
        {
            data.Add(new Snoop.Data.ClassSeparator(typeof(PipeScheduleType)));

             // Nothing at this level yet
        }
예제 #4
0
        Stream(ArrayList data, PipeScheduleType pipeSchedType)
        {
            data.Add(new Snoop.Data.ClassSeparator(typeof(PipeScheduleType)));

            // Nothing at this level yet
        }
예제 #5
0
        Stream(ArrayList data, ElementType sym)
        {
            data.Add(new Snoop.Data.ClassSeparator(typeof(ElementType)));

            // no data at this level yet

            AnnotationSymbolType annoType = sym as AnnotationSymbolType;

            if (annoType != null)
            {
                Stream(data, annoType);
                return;
            }

            AreaReinforcementType areaReinforcementType = sym as AreaReinforcementType;

            if (areaReinforcementType != null)
            {
                Stream(data, areaReinforcementType);
                return;
            }

            AreaTagType areaTagType = sym as AreaTagType;

            if (areaTagType != null)
            {
                Stream(data, areaTagType);
                return;
            }

            BeamSystemType beamSystemType = sym as BeamSystemType;

            if (beamSystemType != null)
            {
                Stream(data, beamSystemType);
                return;
            }

            DimensionType dimType = sym as DimensionType;

            if (dimType != null)
            {
                Stream(data, dimType);
                return;
            }

            //TF
            FabricSheetType fabricST = sym as FabricSheetType;

            if (fabricST != null)
            {
                Stream(data, fabricST);
                return;
            }

            FabricWireType fabricWT = sym as FabricWireType;

            if (fabricWT != null)
            {
                Stream(data, fabricWT);
                return;
            }
            //TFEND

            GroupType groupType = sym as GroupType;

            if (groupType != null)
            {
                Stream(data, groupType);
                return;
            }

            HostObjAttributes hostAtt = sym as HostObjAttributes;

            if (hostAtt != null)
            {
                Stream(data, hostAtt);
                return;
            }

            InsertableObject insObj = sym as InsertableObject;

            if (insObj != null)
            {
                Stream(data, insObj);
                return;
            }

            LevelType levelType = sym as LevelType;

            if (levelType != null)
            {
                Stream(data, levelType);
                return;
            }

            LineAndTextAttrSymbol lineAndTextAttr = sym as LineAndTextAttrSymbol;

            if (lineAndTextAttr != null)
            {
                Stream(data, lineAndTextAttr);
                return;
            }

            LoadTypeBase loadTypeBase = sym as LoadTypeBase;

            if (loadTypeBase != null)
            {
                Stream(data, loadTypeBase);
                return;
            }

            MEPBuildingConstruction mepBldConst = sym as MEPBuildingConstruction;

            if (mepBldConst != null)
            {
                Stream(data, mepBldConst);
                return;
            }

            PathReinforcementType pathReinforcementType = sym as PathReinforcementType;

            if (pathReinforcementType != null)
            {
                Stream(data, pathReinforcementType);
                return;
            }

            RebarBarType rebarBarType = sym as RebarBarType;

            if (rebarBarType != null)
            {
                Stream(data, rebarBarType);
                return;
            }

            RebarCoverType rebarCoverType = sym as RebarCoverType;

            if (rebarCoverType != null)
            {
                Stream(data, rebarCoverType);
                return;
            }

            RebarHookType rebarHookType = sym as RebarHookType;

            if (rebarHookType != null)
            {
                Stream(data, rebarHookType);
                return;
            }

            RebarShape rebarShape = sym as RebarShape;

            if (rebarShape != null)
            {
                Stream(data, rebarShape);
                return;
            }

            RoomTagType roomTagType = sym as RoomTagType;

            if (roomTagType != null)
            {
                Stream(data, roomTagType);
                return;
            }

            SpaceTagType spaceTagType = sym as SpaceTagType;

            if (spaceTagType != null)
            {
                Stream(data, spaceTagType);
                return;
            }

            TrussType trussType = sym as TrussType;

            if (trussType != null)
            {
                Stream(data, trussType);
                return;
            }

            DistributionSysType distSysType = sym as DistributionSysType;

            if (distSysType != null)
            {
                Stream(data, distSysType);
                return;
            }

            MEPCurveType mepCurType = sym as MEPCurveType;

            if (mepCurType != null)
            {
                Stream(data, mepCurType);
                return;
            }

            FluidType fluidType = sym as FluidType;

            if (fluidType != null)
            {
                Stream(data, fluidType);
                return;
            }

            PipeScheduleType pipeSchedType = sym as PipeScheduleType;

            if (pipeSchedType != null)
            {
                Stream(data, pipeSchedType);
                return;
            }

            VoltageType voltType = sym as VoltageType;

            if (voltType != null)
            {
                Stream(data, voltType);
                return;
            }

            WireType wireType = sym as WireType;

            if (wireType != null)
            {
                Stream(data, wireType);
                return;
            }

            ModelTextType modelTxtType = sym as ModelTextType;

            if (modelTxtType != null)
            {
                Stream(data, modelTxtType);
                return;
            }
        }