Exemple #1
0
        public Controlers(PickForm pView, ExternalCommandData _commandData)
        {
            pModel                = new Model();
            this.pView            = pView;
            this.pView.Controllor = this;
            commandData           = _commandData;

            //对pModel中的成员进行初始化
            pModel.curve_id = null;
            pModel.floor_id = null;

            //在模型中生成用于controller的模型参数
            Document doc = _commandData.Application.ActiveUIDocument.Document;
            FilteredElementCollector collector_beams = new FilteredElementCollector(doc);

            collector_beams.OfCategory(BuiltInCategory.OST_StructuralFraming);
            pModel.BeamSymbolsName = new List <string>();
            pModel.BeamSymbols     = new List <FamilySymbol>();
            FamilySymbol familySymbol = null;

            foreach (var item in collector_beams)
            {
                familySymbol = item as FamilySymbol;
                if (familySymbol != null)
                {
                    pModel.BeamSymbolsName.Add(familySymbol.Name.ToString());
                    //族本身加入到相应的文件中
                    pModel.BeamSymbols.Add(familySymbol);
                }
            }

            //初始化当前标高系统,并将标高初始化到Model中

            FilteredElementCollector collector_levels = new FilteredElementCollector(doc);

            collector_levels.OfClass(typeof(Level));
            pModel.levelsName = new List <string>();
            pModel.levels     = new List <Level>();
            Level thelevel = null;

            foreach (var item in collector_levels)
            {
                thelevel = item as Level;
                if (thelevel != null)
                {
                    pModel.levelsName.Add(thelevel.Name);
                    //标高本身加入到列表当中
                    pModel.levels.Add(thelevel);
                }
            }
        }
Exemple #2
0
 public ExecuteEvent()
 {
     pForm = null;
 }
Exemple #3
0
 public ExecuteEvent(PickForm _pform)
 {
     pForm = _pform;
 }