MaterialFunctionAssignment

MaterialFunctionAssignment

Anonymous
Not applicable
1,097 Views
3 Replies
Message 1 of 4

MaterialFunctionAssignment

Anonymous
Not applicable

Hello,

 

In the attachment file you can see the differents materials of a wall. The problem I have it is in one of the material the function is "Thermal/Air Layer", however in my software the value of function is "Isolate", value which can be found in the enum MaterialFunctionAssignment.

 

I tried to use the "LabelUtils.GetLabelFor" thinking it could be a translation problem, but it doesn't work with "MaterialFunctionAssignment".

 

Any clue,

 

Javi

0 Likes
1,098 Views
3 Replies
Replies (3)
Message 2 of 4

maximilian.kurz
Participant
Participant

I have the same problem. How did you solve it?

 

Thanks, Max

0 Likes
Message 3 of 4

RPTHOMAS108
Mentor
Mentor

Can't see any option for this so you can likely only get the translations from the web help i.e.

 

https://knowledge.autodesk.com/support/revit/learn-explore/caas/CloudHelp/cloudhelp/2017/ENU/Revit-M...
https://knowledge.autodesk.com/fr/support/revit/learn-explore/caas/CloudHelp/cloudhelp/2017/FRA/Revi...
https://knowledge.autodesk.com/de/support/revit/learn-explore/caas/CloudHelp/cloudhelp/2017/DEU/Revi...
https://knowledge.autodesk.com/it/support/revit/learn-explore/caas/CloudHelp/cloudhelp/2017/ITA/Revi...
https://knowledge.autodesk.com/ja/support/revit/learn-explore/caas/CloudHelp/cloudhelp/2017/JPN/Revi...
https://knowledge.autodesk.com/ko/support/revit/learn-explore/caas/CloudHelp/cloudhelp/2017/KOR/Revi...

Polish (Polska) missing

https://knowledge.autodesk.com/es/support/revit/learn-explore/caas/CloudHelp/cloudhelp/2017/ESP/Revi...
Below is simplified Chinese (there is no CHT traditional Chinese for this article)
https://knowledge.autodesk.com/zh-hans/support/revit/learn-explore/caas/CloudHelp/cloudhelp/2017/CHS...
https://knowledge.autodesk.com/pt-br/support/revit/learn-explore/caas/CloudHelp/cloudhelp/2017/PTB/R...
https://knowledge.autodesk.com/ru/support/revit/learn-explore/caas/CloudHelp/cloudhelp/2017/RUS/Revi...
The one for Czech (Česko) also not available

 

Those are the majority of the Revit supported languages listed from below:

Use Revit in Other Languages | Revit | Autodesk Knowledge Network

 

Navigate to the help page and then change the language utilising the globe icon.

 

Once you have these translations you can map them to the enum values.

 

Extracted translations for above attached.

 

I haven't tested below but I assume it is more or less right, there are some gaps to fill:

using Autodesk.Revit.DB;

static class CompoundWallLayerNaming
{
	//"Structure [1]",
	//"Substrate [2]",
	//"Thermal/Air Layer [3]",
	//"Membrane Layer",
	//"Finish 1 [4]",
	//"Finish 2 [5]"

	public static string GetWallLayerUIName(Autodesk.Revit.UI.UIApplication App, MaterialFunctionAssignment Val)
	{

		string[] Str = GetName(App);

		switch (Val)
		{
			case MaterialFunctionAssignment.None:
				return "";
			case MaterialFunctionAssignment.Structure:
				return Str[0];
			case MaterialFunctionAssignment.Substrate:
				return Str[1];
			case MaterialFunctionAssignment.Insulation:
				return Str[2];
			case MaterialFunctionAssignment.Finish1:
				return Str[4];
			case MaterialFunctionAssignment.Finish2:
				return Str[5];
			case MaterialFunctionAssignment.Membrane:
				return Str[3];
			default:
				throw new System.ArgumentOutOfRangeException();
		}
	}

	private static string[] GetName(Autodesk.Revit.UI.UIApplication App)
	{

		switch (App.Application.Language)
		{
			case Autodesk.Revit.ApplicationServices.LanguageType.English_USA:
			case Autodesk.Revit.ApplicationServices.LanguageType.English_GB:
				goto En;
			case Autodesk.Revit.ApplicationServices.LanguageType.German:
				goto De;
			case Autodesk.Revit.ApplicationServices.LanguageType.Spanish:
				goto Es;
			case Autodesk.Revit.ApplicationServices.LanguageType.French:
				goto Fr;
			case Autodesk.Revit.ApplicationServices.LanguageType.Italian:
				goto It;
			case Autodesk.Revit.ApplicationServices.LanguageType.Dutch:
			case Autodesk.Revit.ApplicationServices.LanguageType.Hungarian:
				//not listed as supported in language variations link
				goto Exc;
			case Autodesk.Revit.ApplicationServices.LanguageType.Chinese_Simplified:
			case Autodesk.Revit.ApplicationServices.LanguageType.Chinese_Traditional:
				goto Chs;
			case Autodesk.Revit.ApplicationServices.LanguageType.Japanese:
				goto Ja;
			case Autodesk.Revit.ApplicationServices.LanguageType.Korean:
				goto Ko;
			case Autodesk.Revit.ApplicationServices.LanguageType.Russian:
				goto Ru;
			case Autodesk.Revit.ApplicationServices.LanguageType.Czech:
				//translation not found
				goto En;
			case Autodesk.Revit.ApplicationServices.LanguageType.Polish:
				//translation not found
				goto En;
			case Autodesk.Revit.ApplicationServices.LanguageType.Brazilian_Portuguese:
				goto pt_br;
			default:
				goto En;
		}
	Exc:

		throw new System.NotImplementedException();
	En:
		string[] en = new string[6] {
			"Structure [1]",
			"Substrate [2]",
			"Thermal/Air Layer [3]",
			"Membrane Layer",
			"Finish 1 [4]",
			"Finish 2 [5]"
		};
		return en;
	Fr:

		string[] fr = new string[6] {
			"Porteur/Ossature [1] ",
			"Doublage [2] ",
			"Isolant/Vide [3] ",
			"Couche membrane ",
			"Finition 1 [4] ",
			"Finition 2 [5] "
		};
		return fr;
	De:

		string[] de = new string[6] {
			"Tragende Schicht [1]",
			"Träger [2]",
			"Dämmung/Luftschicht [3]",
			"Sperrschicht ",
			"Nichttragende Schicht 1 [4]",
			"Nichttragende Schicht 2 [5]"
		};
		return de;
	It:

		string[] it = new string[6] {
			"Struttura [1]",
			"Sostrato [2]",
			"Strato Termico/Camera d'aria [3]",
			"Strato membrana",
			"Finitura 1 [4]",
			"Finitura 2 [5]"
		};
		return it;
	Ja:

		string[] ja = new string[6] {
			"構造[1]",
			"下地[2]",
			"断熱層または空気層[3]",
			"防水層",
			"仕上げ 1 [4]",
			"仕上げ 2 [5]"
		};
		return ja;
	Ko:

		string[] ko = new string[6] {
			"구조 [1]",
			"하지재 [2]",
			"단열/공기 층 [3]",
			"멤브래인 층",
			"마감재 1 [4]",
			"마감재 2 [5]"
		};
		return ko;
	Es:

		string[] es = new string[6] {
			"Estructura [1]",
			"Substrato [2]",
			"Capa térmica/aire [3]",
			"Capa membrana",
			"Acabado 1 [4]",
			"Acabado 2 [5]"
		};
		return es;
	Chs:

		string[] chs = new string[6] {
			"结构 [1]",
			"衬底 [2]",
			"保温层/空气层 [3]",
			"涂膜层",
			"面层 1 [4]",
			"面层 2 [5]"
		};
		return chs;
	pt_br:

		string[] pt_br = new string[6] {
			"Estrutura [1]",
			"Substrato [2]",
			"Camada térmica/de ar [3]",
			"Camada da membrana",
			"Acabamento 1 [4]",
			"Acabamento 2 [5]"
		};
		return pt_br;
	Ru:

		string[] ru = new string[6] {
			"Структура [1]",
			"Основа [2]",
			"Термическая/воздушная прослойка [3]",
			"Изолирующее покрытие",
			"Отделка 1 [4]",
			"Отделка 2 [5]"
		};
		return ru;

	}

}

 

 

 

Message 4 of 4

maximilian.kurz
Participant
Participant

Great, thank you for the extensive answer!

0 Likes