Esempio n. 1
0
        private bool AddConfig()
        {
            try
            {
                if (model2 != null)
                {
                    WriteLog("AddConfig : " + newConfig, 1);
                    return(model2.AddConfiguration2(newConfig, "", "", false, false, false, true, 0));
                }
            }
            catch (Exception ex)
            {
                WriteLog(ex.ToString(), 2);
                throw;
            }

            return(false);
        }
Esempio n. 2
0
        public void Change()
        {
            ModelDoc2 swModel = (ModelDoc2)Component.GetModelDoc2();

            string[] names = (string[])swModel.GetConfigurationNames();

            for (int i = 0; i < names.Length; i++)
            {
                if (NewConfig == names[i])
                {
                    return;
                }
            }

            swModel.ShowConfiguration(OldConfig);
            swModel.AddConfiguration2(NewConfig, "", "", false, false, false, true, 0);

            swModel.Save();
        }