Esempio n. 1
0
 public void Execute(UIApplication app)
 {
     //          foreach(string s in Globals.full_files_name_variables)
     //              TaskDialog.Show("Revit",s);
     ThisApplication.Remove_Parameter(Globals.full_files_name_variables,
                                      Globals.full_pram_name_variables);
     return;
 }
Esempio n. 2
0
        public void Execute(UIApplication app)
        {
            //          foreach(string s in Globals.full_files_name_variables)
            //              TaskDialog.Show("Revit",s);

            ThisApplication.Add_SP_To_Families(Globals.full_files_name_variables,
                                               Globals.full_pram_name_variables,
                                               Globals.instance_or_not);
            return;
        }
Esempio n. 3
0
        void TreeView1DoubleClick(object sender, EventArgs e)
        {
            TreeNode node = treeView1.SelectedNode;

            if (treeView1.SelectedNode.Equals(null))
            {
                return;
            }
            if (node.ForeColor == System.Drawing.Color.Blue)
            {
                return;
            }
            txtName.Text = last_Selected_node = node.Text;
            txtGUID.Text = SP_andItsDetials[node.Text].GUID.ToString();
            //cbGroup.Text = SP_andItsDetials[node.Text].Definition.

            ckbInstance.Checked = SP_andItsDetials[node.Text].IsInstance;
            UnitGroup ug = UnitUtils.GetUnitGroup(SP_andItsDetials[node.Text].Definition.UnitType);

            cbDesc.Text = tmp_s = ug.ToString();
            //txtDes.Text = SP_andItsDetials[node.Text].StorageType.ToString();
            DefinitionFile     deFile = ThisApplication.CachedApp.OpenSharedParameterFile();
            ExternalDefinition ex     = ThisApplication.RawFindExternalDefinition(
                deFile, treeView1.SelectedNode.Text);

            cbGroup.Text  = ex.OwnerGroup.Name;
            lblCount.Text = "This SP founded in " + Globals.SP_andAllItsFiles[node.Text].Count + " file/s";
            cbSPtype.Items.Clear();
            List <ParameterType> tmp = Group_ParameterTypesOn_Discipline[cbDesc.Text];

            foreach (ParameterType p in tmp)
            {
                cbSPtype.Items.Add(p.ToString());
            }
            Globals.parm_to_Replace = txtName.Text;
            cbSPtype.Text           = SP_andItsDetials[node.Text].Definition.ParameterType.ToString();
        }
Esempio n. 4
0
 public void Execute(UIApplication app)
 {
     ThisApplication.Rename_Family_Parameters(Globals.SP_andAllItsFiles[Globals.parm_to_Replace].ToList());
 }
Esempio n. 5
0
        void Button6Click(object sender, EventArgs e)
        {
            treeView1.Nodes.Clear();
            treeView1.Nodes.Add("Common SP/s");
            treeView1.Nodes[0].ForeColor = System.Drawing.Color.Blue;
            Globals.SP_andAllItsFiles.Clear();
            SP_andItsDetials.Clear();
            cbSPtype.Items.Clear();
            cbGroup.Items.Clear();
            cbDesc.Items.Clear();
            //	treeView1.Nodes[0].NodeFont = new Font(triStateTreeView1.Font, FontStyle.Bold);
            //triStateTreeView1.Refresh();
            //listBox3.Items.Clear();
//			Globals.SP_with_groups.Clear();
//			ThisApplication.fill_all_SP(app.OpenSharedParameterFile());
            //add_SP_to_tri();
            int i = 1;

            //TaskDialog.Show("Revit",file_SPs.Value.Count.ToString());
            ThisApplication.get_all_paramters(Globals.full_files_name_variables);

            foreach (var file_SPs in Globals.files_with_SP)
            {
                treeView1.Nodes.Add(get_file_name(file_SPs.Key));

                //List<string> tmp = new List<string>();
                //	string tmp = group_and_SPs.Key;
                //		TaskDialog.Show("Revit",file_SPs.Value.Count.ToString());
                treeView1.Nodes[i].ForeColor = System.Drawing.Color.Blue;
                //triStateTreeView1.Nodes[i].NodeFont.Bold = true;
                //	treeView1.Nodes[i].NodeFont = new Font(triStateTreeView1.Font, FontStyle.Bold);

                foreach (FamilyParameter SP in file_SPs.Value)
                {
                    treeView1.Nodes[i].Nodes.Add(SP.Definition.Name);
                    if (!SP_andItsDetials.ContainsKey(SP.Definition.Name))
                    {
                        SP_andItsDetials.Add(SP.Definition.Name, SP);
                    }
                    else
                    {
                        SP_andItsDetials[SP.Definition.Name] = SP;
                    }
                    if (Globals.SP_andAllItsFiles.ContainsKey(SP.Definition.Name))
                    {
                        Globals.SP_andAllItsFiles[SP.Definition.Name].Add(file_SPs.Key);
                    }
                    else
                    {
                        Globals.SP_andAllItsFiles.Add(SP.Definition.Name, new SortedSet <string>());
                        Globals.SP_andAllItsFiles[SP.Definition.Name].Add(file_SPs.Key);
                    }
                }
                //tmp.Clear();
                // triStateTreeView1.Nodes[i]
                i++;
            }
            foreach (var ob in Globals.SP_andAllItsFiles)
            {
                //TaskDialog.Show("Revit",ob.Key+ " || "+Globals.full_files_name_variables.Count.ToString());
                if (ob.Value.Count == Globals.full_files_name_variables.Count)
                {
                    treeView1.Nodes[0].Nodes.Add(ob.Key);
                }
            }
            foreach (DefinitionGroup s in Globals.all_groups)
            {
                cbGroup.Items.Add(s.Name);
            }
            DisciplineComboBoxFill(cbDesc, cbSPtype);
            txtName.Text = cbGroup.Text = cbSPtype.Text = cbDesc.Text = lblCount.Text = txtGUID.Text = "";
            // PrintOutToDebug(S
//			foreach(ParameterType p in ParameterType.)
//				cbSPType.Items.Add(p.ToString());
            // cbSPType.DataSource = ParameterType.
//			//Globals.all_SP_variables = ThisApplication.all_SP;
//			Globals.common_pram_name_variables.Clear();
//			if(Globals.full_files_name_variables.Count == 0)
//				return;
//			ThisApplication.get_all_paramters(Globals.full_files_name_variables);
//			foreach(string s in Globals.common_pram_name_variables)
//			{ listBox2.Items.Add(s); listBox3.Items.Add(s); }
        }