24.12.2012 Views

ER/Studio - Embarcadero Technologies Product Documentation

ER/Studio - Embarcadero Technologies Product Documentation

ER/Studio - Embarcadero Technologies Product Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

AUTOMATING <strong>ER</strong>/STUDIO ><br />

See Also<br />

Related Topics<br />

Assigning Object Appearance and Behavior Using Properties<br />

Properties are Object attributes that determine Object appearance or behavior. Color, count, name and ID all are<br />

properties common to many objects. Some, such as ID, are usually read-only. Others can be changed. <strong>ER</strong>/<strong>Studio</strong><br />

immediately reflects property modifications by updating internal data.<br />

Dim MyDiagram As Diagram<br />

Dim MyModel As Model<br />

Dim MyEntity As Entity<br />

Dim EntName As String<br />

Dim EntID As Integer<br />

Set MyDiagram = DiagramManager.ActiveDiagram<br />

Set MyModel = MyDiagram.ActiveModel<br />

EntID = 1 ‘We want the name of the Entity that <strong>ER</strong>/<strong>Studio</strong> has identified as ID =1<br />

Set MyEntity = MyModel.Entities.Item(EntID)<br />

EntName = MyEntity.EntityName<br />

‘Now we can display EntName in a MsgBox, write it to a text file, or<br />

‘change it and re-name the Entity.<br />

Performing Complex Actions Using Methods<br />

Methods perform actions more complex than the simple setting or reading of a property. For example, OpenFile() is<br />

a DiagramManager method that in turn invokes a number of other operations: it must navigate the directory/file<br />

system, allocate resources for file handling, keep track of the file handle and attributes and so on.<br />

Dim MyDiagram As Diagram<br />

Dim strFile As String<br />

strFile = "C:\Documents and Settings\Owner\Application<br />

Data\<strong>Embarcadero</strong>\<strong>ER</strong><strong>Studio</strong>\Model\MyModel.dm1"<br />

Set MyDiagram = DiagramManager.OpenFile(strFile)<br />

Sample Macros Installed with <strong>ER</strong>/<strong>Studio</strong><br />

Sample macros are included with the installation of <strong>ER</strong>/<strong>Studio</strong>. An extensive set of working sample code is also<br />

included as part of the Automation Interface Reference Code Reference chapter in the on-line Automated Interface<br />

Reference.<br />

The following provides brief descriptions of the functionality of the sample macros. The header of each macro includes<br />

more extensive usage details. Most installed macros are also in the help file in the Sample Code section for ease of<br />

cutting and pasting and for comparison purposes.<br />

• Meta Data Management Macros<br />

• Model Layout Macros<br />

• Modeling <strong>Product</strong>ivity Macros<br />

• Physical Modeling Macros<br />

EMBARCAD<strong>ER</strong>O TECHNOLOGIES > <strong>ER</strong>/STUDIO® 8.0.3 US<strong>ER</strong> GUIDE 304

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!