예제 #1
0
        // this reads through the fields associated with the unit style schema
        // it passes these down to the readsubentity method that then reads
        // through all of the fields in the subschema
        // currently always returns true
        private bool ReadRevitUnitStyles(Entity elemEntity, Schema schema)
        {
            // provide a default list to start with - this will be populated
            // per the below
            RsuUsr.Clear();

            // element 0 is the root schema
            // subschema's start at 1
            List <Entity> schemaList = GetSchemaEntities(elemEntity, schema);

            if (schemaList.Count <= 1)
            {
                return(false);
            }

            for (int i = 1; i < schemaList.Count; i++)
            {
                RsuUsrSetg.Add(SchemaUnitUtil.DefaultSchemaUsr(i - 1));
                ReadSubSchema(schemaList[i], schemaList[i].Schema, RsuUsrSetg[i - 1]);
            }
            return(true);
        }
예제 #2
0
        // test user settings
        // read and list current values
        // change the names of the current unit styles
        // save

//		private void test21()
//		{
//			logMsg("");
//			logMsgDbLn2("user settings file", "before");
//			logMsg("");
//			ListUnitDictionary<SchemaDictionaryUsr, SchemaUsrKey>(SmUsrSetg.UnitStylesList, 4);
//
//			ModifyConfigSettings("test21");
//
//			SmUsr.Save();
//
//			logMsgDbLn2("user settings file", "after");
//			logMsg("");
//			ListUnitDictionary<SchemaDictionaryUsr, SchemaUsrKey>(SmUsrSetg.UnitStylesList, 4);
//		}



        // test set to the generic list with user names
        private void test4()
        {
            // first read and display the current settings
            RsMgr.Read();

            logMsg("");
            logMsgDbLn2("revit settings", "before");
            RevitSettingsBase.ListRevitSettingInfo();
            logMsg("");

            SchemaUnitUtil.MakeDefaultUnitStyles();

            if (!RsMgr.Save())
            {
                logMsgDbLn2("revit save settings", "failed");
                return;
            }

            logMsg("");
            logMsgDbLn2("revit settings", "after");
            RevitSettingsBase.ListRevitSettingInfo();
            logMsg("");
        }