I am trying to write a macro to remove a column from all views in the active submodel. I have successfully done this with remove attributes(cols) from entities, works great. Any help/pointers would be greatly appreciated.Ray
' code to remove the column below from any view that has it.
' but leave the column in the table
Dim MyDiagram As Diagram
Dim MyModel As Model
Dim MySubModel As SubModel
Dim vwDisp As ViewDisplay
Dim vw As View
Dim vwField As ViewField
Dim vId As Integer
Set MyDiagram = DiagramManager.ActiveDiagram
Set MyModel = MyDiagram.ActiveModel
Set MySubModel = MyModel.ActiveSubModel
For Each vwDisp In MySubModel.ViewDisplays
Set vw = vwDisp.ParentView
For Each vwField In vw.ViewFields
If vwField.ParentColumnName = "Never_in_view_column" Then
' I want to do this. How?
vId = vwField.ID
vw.ViewFields.Remove(vId) ' this is NOT valid
Anyone? Is there a way to remove a column from a view without affecting the underlying table? Thank you!
Powered by IDERA