Example #1
0
        protected DataType.ConnectionType getEndtype(Autodesk.Revit.DB.Element element, RevitParam.ParameterName parameter)
        {
            DataType.ConnectionType endtype = DataType.ConnectionType.NONE;
            Parameter param = RevitParam.GetParameter(element, parameter);

            if (param != null && !string.IsNullOrEmpty(param.AsString()))
            {
                endtype = DataType.EnumString.ConnectionType.GetBySecond(param.AsString().ToUpper());
            }
            return(endtype);
        }
Example #2
0
        //Component가 Element로 부터 정보를 얻는다!
        public Component(PCFData data, Autodesk.Revit.DB.Element element)
        {
            this.Data = data;

            //초기화
            this.Misc_Spec = new List <string>(5);
            this.KeyPoints = new List <DataType.KeyPoint>();

            //파라미터 값을 추가하는 과정
            this.Component_Type       = RevitParam.GetParameter(element, RevitParam.ParameterName.Type).AsString();
            this.Component_Identifier = ++elementIdentificationNumber;

            //Material 처리
            this.Material_Identifier = this.Data.GetMaterialData(RevitParam.GetParameter(element, RevitParam.ParameterName.Item_Code).AsString()).Material_Identifier;

            this.Category    = DataType.EnumString.CATEGORY.GetBySecond(RevitParam.GetParameter(element, RevitParam.ParameterName.Category).AsString());
            this.Piping_Spec = RevitParam.GetParameter(element, RevitParam.ParameterName.Piping_Spec).AsString();
            this.Unique_Component_Identifier = element.UniqueId;
        }
Example #3
0
 public Element(PCFData data, Autodesk.Revit.DB.Element element) : base(data, element)
 {
     this.Skey = RevitParam.GetParameter(element, RevitParam.ParameterName.Skey).AsString();
 }
Example #4
0
        public void CreateComponents(Autodesk.Revit.DB.Element element)
        {
            Component component = null;

            //element가 파이프일 경우
            if (element is Autodesk.Revit.DB.Plumbing.Pipe)
            {
                component = new Pipe(this, element);
            }
            else if (element.Category.Id.IntegerValue == (int)BuiltInCategory.OST_PipeFitting || element.Category.Id.IntegerValue == (int)BuiltInCategory.OST_PipeAccessory)
            {
                //TODO: (하) 타입을 확인하는 다른 방법이 있는지 찾아보자.
                string type = RevitParam.GetParameter(element, RevitParam.ParameterName.Type).AsString().ToUpper();
                switch (type)
                {
                //TODO: (상) ELBOW SKEY의 결정은 EndType과 각도로 결정된다. 자동으로 결정할 수 있을까?
                case ("ELBOW"):
                    component = new Elbow(this, element);
                    break;

                case ("TEE"):
                    component = new Tee(this, element);
                    break;

                case ("FLANGE"):
                    component = new Flange(this, element);
                    break;

                case ("VALVE"):
                    component = new Valve(this, element);
                    break;

                case ("REDUCER-CONCENTRIC"):
                    component = new Reducer_Concentric(this, element);
                    break;

                case ("REDUCER-ECCENTRIC"):
                    component = new Reducer_Eccentric(this, element);
                    break;

                case ("FLANGE-BLIND"):
                    component = new Flange_Blind(this, element);
                    break;

                case ("CAP"):
                    component = new Cap(this, element);
                    break;

                case ("COUPLING"):
                    component = new Coupling(this, element);
                    break;

                case ("GASKET"):
                    component = new Gasket(this, element, this.Components);
                    break;

                case ("FILTER"):
                    component = new Filter(this, element);
                    break;

                case ("INSTRUMENT"):
                    component = new Instrument(this, element);
                    break;

                case ("NONE"):
                    return;
                }
            }

            if (component != null)
            {
                this.Components.Add(component);
            }
            else
            {
                throw new Exception("Fail: not supported component type. Sorry! \n" + element.Name);
            }

            if (element is FamilyInstance)
            {
                ICollection <ElementId> SubComponentIds = (element as FamilyInstance).GetSubComponentIds();
                if (SubComponentIds != null)
                {
                    foreach (ElementId id in SubComponentIds)
                    {
                        FamilyInstance subElement = element.Document.GetElement(id) as FamilyInstance;
                        if (subElement != null)
                        {
                            this.CreateComponents(subElement);
                        }
                    }
                }
            }
        }