public static void MakeDefaultUnitStyles() { RsuUsr.Clear(); for (int i = 0; i < DEFAULT_COUNT_USER; i++) { for (int j = 0; j < DEFAULT_COUNT_STYLES; j++) { SchemaDictionaryUsr unitStyle = DefaultSchemaUsr((i * 10) + j); unitStyle[SchemaUsrKey.USER_NAME].Value = UserNames[i]; RsuUsrSetg.Add(unitStyle); } } }
// 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); }