Couple of Macro requests? Automated View Generation/Metadata update / Data Model Metrics


we are looking for a macro that can do the following:

1. Take each table in turn

2. Create a view based on the physical data model's table exact structure, with a specific pre-fix

Another one:

1. Can we have the Export Meta Data to Excel Version 3.1 extended to include the name of the Domain to which an attribute is bound?

Final One

Data Model Metrics:

Can we have a macro that produces the following metrics for all models in a DM1 file, split by model:

1) # of Entities

1b) # of Entities without definitions

2) # of attributes

2b) # of attributes without definitions

3) # of relationships

4) # of Primary, Alternate & Foreign Keys

Kind regards


No Data
  • Here's a macro that will create a basic view for all tables.  It'll add a suffix of _V but you can modify the macro to fit your needs.

    2287.Create basic views from all entities.txt
    'TITLE:  Create basic view for all entities
    'ER/Studio Variables
    Dim diag As Diagram
    Dim mdl As Model
    Dim submdl As SubModel
    Dim ent As Entity
    Dim entdisp As EntityDisplay
    Dim rel As Relationship
    Dim reldisp As RelationshipDisplay
    Dim vw As View
    Dim MyView As View
    Dim vwdisp As ViewDisplay
    Sub Main
    	Dim HorizPo As Integer
    	Dim VertPo As Integer
    	Dim MyDDL As String
    	Dim MyParentViewRelationship As ViewRelationships
    	Dim MyViewRelationship As ViewRelationship
    	Set diag = DiagramManager.ActiveDiagram
    	Set mdl = diag.ActiveModel
    	Set submdl = mdl.ActiveSubModel
    	Set MyParentViewRelationship = mdl.ViewRelationships
    	HorizPo = 100
    	VertPo = 100
    	For Each ent In mdl.Entities
    		Set MyView = mdl.Views.Add(HorizPo, VertPo)
    		MyView.Name = ent.TableName & "_V"
    		Set MyParentViewRelationship = MyView.ParentViewRelationships
    End Sub