Python - Helmut-Ortmann/EnterpriseArchitect_ScriptDotNet GitHub Wiki

Python

Under construction!!!!!

If you know how to develop and run Python, it's simple. Add one line in the EA VB Script to call your *.py file:

Dim result
' Run Python with the file 'MyPythonFile.py'
' The Windows environemt variable 'Path' should contain your Python bin folder
' The Python Scripts uses the first EA Instance with its repository
' You have full access to the EA Repository and the EA GUI
result = runPython("%EA_SCRIPT_HOME%MyPythonFile.py", "MakeSomeThing", "", "", "")

' Show the result in a message box.
' Consider using the EA GUI for your results.
MsgBox "Output='" & vbCRLF & result, 0, "Output of RunPythonDemoTextOutput"

Prerequisites

  • Python installed
    • Environment varibale 'PATH' contains path to Python.exe

Installation

  1. Clone 'EnterpriseArchitect_ScriptDotNet'
  2. Environment Variables
    • EA_SCRIPT_HOME Folder with all the .py,.exe,*.dll files
  3. Make sure PATH contains the correct path to your Python environment
  4. Install in EA the VB Scripts (if you don't use the delivered EA model):
    • RunCommandVb.vbs

EA Script-Types

In the EA Script-Groups you create VB Scripts which later appear in Context Menues.

Group Description ContextMenu of
Browser Works from Browser Browser
Diagram Works from Diagram Diagram
ModelSearch Result row in Search Window Selected rows in Search Window
ModelSearch Result row in Search Window no
Search Should be a Search, entry 'Script' in Category Search Window no

Script Group and Browser Context Script Group Project Search Script Group Model Search

Import/Export EA Scripts

  • Configure
    • Transfer
      • Export Referenced Data
      • Import Referenced Data

Export Referenced Data

Glossary

  • API Application programming Interface
  • COM

References