示例#1
0
        public Controllor(ChsForm pView, ExternalCommandData _commandData)
        {
            pModel                = new Model();
            this.pView            = pView;
            this.pView.Controllor = this;
            commandData           = _commandData;



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

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

            foreach (var item in collector)
            {
                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);
                }
            }
        }
示例#2
0
 public ExecuteEvent()
 {
     pForm = null;
 }
示例#3
0
 public ExecuteEvent(ChsForm _pform)
 {
     pForm = _pform;
 }