Index: /issm/trunk/src/m/utils/Enum/BuildEnum.m
===================================================================
--- /issm/trunk/src/m/utils/Enum/BuildEnum.m	(revision 8928)
+++ /issm/trunk/src/m/utils/Enum/BuildEnum.m	(revision 8928)
@@ -0,0 +1,64 @@
+function enum=BuildEnum(string)
+%BUILDENUM: build enum out of string
+
+
+%some processing: 
+
+if findstr(string,'icesheet'),
+	indices=findstr(string,'icesheet');
+	for i=1:length(indices),
+		string(indices(i):(indices(i)+7))='IceSheet';
+	end
+end
+
+if findstr(string,'iceshelf'),
+	indices=findstr(string,'iceshelf');
+	for i=1:length(indices),
+		string(indices(i):(indices(i)+7))='IceShelf';
+	end
+end
+
+
+if strncmpi(string,'elementon',9),
+	string(1:9)='ElementOn';
+	string(10)=upper(string(10));
+end
+
+if strncmpi(string,'nodeon',6),
+	string(1:6)='NodeOn';
+	string(7)=upper(string(7));
+end
+
+if strncmpi(string,'numberof',8),
+	string(1:8)='NumberOf';
+	string(9)=upper(string(9));
+end
+
+if findstr(string,'_'),
+	indices=findstr(string,'_');
+	for i=1:length(indices),
+		string(indices(i)+1)=upper(string(indices(i)+1));
+	end
+	string(indices)=[];
+end
+
+if findstr(string,'2d'),
+	indices=findstr(string,'2d');
+	for i=1:length(indices),
+		string(indices(i)+1)=upper(string(indices(i)+1));
+	end
+end
+
+if findstr(string,'3d'),
+	indices=findstr(string,'3d');
+	for i=1:length(indices),
+		string(indices(i)+1)=upper(string(indices(i)+1));
+	end
+end
+
+
+
+%take first letter of string and make it uppercase: 
+string(1)=upper(string(1));
+
+enum=eval([string 'Enum']);
