Hi Tim,
To clarify: No, model views are not directly accessible through the API. There is no class ModelView or similar, and you can't create a model view by calling AddNew() on any collection.
But they are stored in a table in the database, t_xrefsystem, and as such are available for manipulation through the API. The calls in question are:
- Repository.SqlQuery(), which is officially supported but can only retrieve information (SQL 'select' clauses)
- Repository.Execute(), which is undocumented and unsupported, but can be used to make changes to the database (SQL 'insert' and 'update' clauses).
The EA database schema is itself undocumented; you're simply not meant to go wandering about in there and if you do, and get something wrong, you will indeed find yourself as lonely as a cloud.
In this case, t_xrefsystem holds other things besides model views so you need to figure out what signifies that a row in that table represents a model view, and then how a view definition is represented.
This amounts to reverse engineering, and while I haven't heard of any instance where Sparx has actually gone after anyone for doing so (Geert and Thomas are still at large, after all), I would certainly think twice about going down that route if I were on a government contract. (Just guessing from your location.)
Cheers,
/Uffe