As We Use Multiple Workspaces in order to best create and display ERD’s within our Models, I produce a Report of Entity’s and there attachment to Workspaces (basically 2 Columns, Entity.Name and Workspace.Name)
And I want to list All Entities and the Workspace(s) they are attached to within the Model
So If Table1 is found within All Items as well as Within Workspace1 then the Chart would be
Table | Workspace
Table1 | All Items
Table1 | Workspace1
I know I can apply brute force and build Arrays of the entities listed by Workspace and them Basically Join the Arrays as I Iterate All the Arrays and produce the result
But I would Like to know, If I itererate all the Entities of a Model, Is there anyway from the Entity Name or some component of the Entitiy to iterate the workspaces or Direct method to find workspaces by Entity.
This is the Code I have which iterates the workspaces and then the Entities within the Workspaces.
var app = System.GetInterface(‘Application’);
var Model = app.Models.GetObject(0);
for (i=0; i<Model.Workspaces.Count; i++) // iterate Workspaces
Workspace = Model.Workspaces.GetObject(i);
Log.Information('Workspace = '+Workspace.Name);
for (e=0; e<Workspace.ShapeList.Count; e++) // iterate entities
Entity = Model.Entities.GetObjectByName(Workspace.ShapeList.GetObject(e).Name);
Log.Information('Entity.Name = '+Entity.Name);
Please let me know.