Hi Joel,
You could write a plugin.
Another way is to use the Element Search. It's commonly used for search objects into the project, but you also can perform actions in such queries. To do that:
- Open **Menu Project -> Search for Elements ** (Ctrl+F3).
- In 'Element Type' select 'Enumerable'
- Write this in the query area:
var entity = p.EntityModel.Vertices.FirstOrDefault(e=>e.Name=="Customer");
var prefix = entity.Name;
var fields = p.GetAllFieldsForGroupableModelElement(entity);
var newNames = new List<String>();
foreach(var f in fields)
{
f.Name = f.Name.Replace(prefix, string.Empty);
newNames.Add(f.Name);
}
return newNames;
- Click 'Run Query'. That's it.
Above example would run it for just one entity named 'Customer'. If you want to run on every entity in the project, this would be the query:
var newNames = new List<String>();
var allEntities = p.EntityModel.Vertices;
foreach(var entity in allEntities)
{
var prefix = entity.Name;
var fields = p.GetAllFieldsForGroupableModelElement(entity);
foreach(var f in fields)
{
f.Name = f.Name.Replace(prefix, string.Empty);
newNames.Add(entity.Name + "." + f.Name);
}
}
return newNames;
Hope that helps