Welcome to ModelRight Database Design Tool - Database Modeling Done Right Sign in | Join | Help

Remove All Table Graphic Overrides

File Details
Downloads: 98 File Size: 615 bytes
Posted By: admin Views: 162
Date Added: Fri, Oct 09 2009

The script below will illiustrates how to remove a property from all Table Graphic objects.  It removes "Name Background Color" and "Fill Color", but can easily be changed to remove any other property.  To run it:

1) bring up the Script Explorer

2) right click on "User Defined" and select "New Script"

3) copy/paste the script below into the edit control

4) hit the run button (the first icon in the toolbar above the edit control)

Note: you can undo/redo the effects of this script as with any Model changes
 

Sub Evaluate_OnLoad()
 Set Context = CreateObject("SCF.ScriptContext")
 Set Document = Context.ScriptDocument
 Set Script = Context.Object
 Set Options = Context.Options

 Set Model = Script.Model
 Model.BeginTransaction("Remove Graphic Overrides")
    For Each ModelSubset In Model.AsObject.Children("Model Subset")
     For Each Diagram In ModelSubset.Children("Diagram")
      For Each TableGraphic In Diagram.Children("Table Graphics")
    TableGraphic.DeleteProperty("Name Background Color")
    TableGraphic.DeleteProperty("Fill Color")
   Next
  Next
    Next
 Model.EndTransaction
End Sub

Comments
No comments exist for this file.

Add Comment

Name (required)
Web Site (optional)
Comment (required)
Add