How can I convert entity name to lowercase?
How can I run scripts that are saved in script explorer?
The below script will convert all attribute and entity names to lower case. Run the script in Scripting Window (Tools menu).
function main()
{
var app = System.GetInterface('Application');
var Model = app.Models.GetObject(0);
//... parameter in GetObject determines with which model the script should work.
//0 = first model listed in the Application View, 1 = second model listed in the Application View etc.
for (e=0; e<Model.Entities.Count; e++)
{
Entity = Model.Entities.GetObject(e);
Entity.Lock();
Entity.Name = Entity.Name.toLowerCase(); //change name of entity
Entity.UnLock();
Log.Information("Name of entity "+Entity.Name+" was changed.");
for (a=0; a<Entity.Attributes.Count; a++)
{
Attribute = Entity.Attributes.GetObject(a);
Attribute.Lock();
Attribute.Name = Attribute.Name.toLowerCase(); //change name of attribute
Attribute.UnLock();
Log.Information("Name of attribute "+Attribute.Name+" in entity "+Attribute.Owner.Name+" was changed.");
}
}
}
The methodology is same for different objects in the object model. Please see the Help menu | Reference Guide.
How to run a script that is saved in the script explorer:
Please see Manual | Customization - Sample chapter.
(Flash movie: http://modeling.inside.quest.com/entry.jspa?externalID=1140&categoryID=158)
© ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center