sorry, i'm a noob to this. i've written the following attempting to add attributes to a physical model but below when i attempt:
MyAttribute.DefaultName = "timestamp now"
it doesn't work.
i'm tryin g to set the default value from the data dictionary defaults.
Dim MyDiagram As Diagram
Dim MyModel As Model
Dim MyEntity As Entity
Dim MyAttribute As AttributeObj
Set MyDiagram = DiagramManager.ActiveDiagram
Set MyModel = MyDiagram.ActiveModel
If Not MyModel.Logical Then
If MsgBox("This macro will add audit columns to all objects.", vbOkCancel) = vbOK Then
For Each MyEntity In MyModel.Entities
Set MyAttribute = MyEntity.Attributes.Add("create_date", False)
MyAttribute.Datatype = "TIMESTAMP"
MyAttribute.Definition = "The datetime the record was created."
MyAttribute.NullOption = "NOT NULL"
MyAttribute.DefaultName = "timestamp now" 'not working
MsgBox "This macro is designed to run in the Physical model. Please switch to Physical model first."
Good to know you already figured it out. I had this experience and I also want to share it.
--- Door Austin
Powered by IDERA