HomeBlogsPaweł GłowackiAutomating ER/Studio from Delphi 2009 - Translating build-in macros to Delphi
Automating ER/Studio from Delphi 2009 - Translating build-in macros to Delphi
This is a post for my beloved Grzeniuś:-).
I have change the describtion of my blog to "Delphi Programming" and added "Delphi Programming" category. Watch out TIOBE index! Delphi is strongly rising.
The SDC conference this week was very good and Delphi track was very rich and interesting. In the evening, at the first conference day, during relaxed "Delphi Tips & Tricks" session with Bob Swart and Nick Hodges I have demonstrated automating ER/Studio application in Delphi code from a Delphi VCL Forms application. The first thing is to verify that you have ER/Studio ActiveX VCL wrappers installed on Delphi Tool Palette. The process of importing ER/Studio COM type library into was described in my previous post "Automating ER/Studio from Delphi - Getting Started". The left pane in the main ER/Studio window has got 5 tabs. On the "Macros" tab there is big collection of VBA macros installed "out of the box".

Here is the source of the "Auto-Create New Diagram" macro:

Just drop a "TApplication" component from Delphi Tool Palette on the form and execute the following Delphi code:

The translation is slightly modified. "aEntity" variable stores a reference to the first entity added so it is not neccessary to obtain it again. Executing this code will generate the following ER/Studio diagram

That’s interesting and gives a power of controlling powerful ER/Studio functionality from Delphi code.
I have change the describtion of my blog to "Delphi Programming" and added "Delphi Programming" category. Watch out TIOBE index! Delphi is strongly rising.
The SDC conference this week was very good and Delphi track was very rich and interesting. In the evening, at the first conference day, during relaxed "Delphi Tips & Tricks" session with Bob Swart and Nick Hodges I have demonstrated automating ER/Studio application in Delphi code from a Delphi VCL Forms application. The first thing is to verify that you have ER/Studio ActiveX VCL wrappers installed on Delphi Tool Palette. The process of importing ER/Studio COM type library into was described in my previous post "Automating ER/Studio from Delphi - Getting Started". The left pane in the main ER/Studio window has got 5 tabs. On the "Macros" tab there is big collection of VBA macros installed "out of the box".
Here is the source of the "Auto-Create New Diagram" macro:
Just drop a "TApplication" component from Delphi Tool Palette on the form and execute the following Delphi code:
The translation is slightly modified. "aEntity" variable stores a reference to the first entity added so it is not neccessary to obtain it again. Executing this code will generate the following ER/Studio diagram
That’s interesting and gives a power of controlling powerful ER/Studio functionality from Delphi code.
Tags:
COM
Delphi
Delphi 2009
Delphi Programming
ER/Studio
ER/Studio
OLE Automation
OLE Automation
source-code
source-code


Crazy about Delphi Programming!
Comments
-
Please login first in order for you to submit comments
- Page :
- 1
Nice.

However, IMHO I prefer the ECO approach. I control, not how the physical layout in the database is, but how the model is represented in my code, without any plumbing to access that model.
With ECO, I don't care how the database look at the table level. I find that very appealing.
Unfortunately it's doesn't seem like Embarcadero is interested in ECO, but instead pushes their existing product(s)
Prove me wrong, Embarcadero