Author Topic: Control EA via command line  (Read 23447 times)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13282
  • Karma: +556/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Control EA via command line
« Reply #15 on: June 16, 2021, 05:22:58 pm »
https://www.sparxsystems.com/enterprise_architect_user_guide/15.2/automation/app.html

Quote
The App object represents a running instance of Enterprise Architect. Its object provides access to the Automation Interface.

The equivalent in C# would call Marshal.GetActiveObject
Ok, but that is to connect to an already running instance isn't it?
I think Jörg wants to start a new instance of EA.

The code I copied came directly from the manual in the section C#. Is that not correct?

Geert

jörg

  • EA User
  • **
  • Posts: 28
  • Karma: +0/-0
    • View Profile
Re: Control EA via command line
« Reply #16 on: June 16, 2021, 10:05:40 pm »
Thanks for the replies.

@Eve: I also tried this approach just for test, but the call to Marshal.GetActiveObject("EA.App") returned null. And yes, EA was running befor calling  ;).

@ Geert: I've found this article while searching a solution, too. Unfortunately it doesn't work  :( as described in my question.

There seems to be something wrong with the types. I have no clue why this happens and how to fix that. I tried the code in several VS-Projects, with different .NET Framework versions and .NET Core 3. Always the same result.

jörg

  • EA User
  • **
  • Posts: 28
  • Karma: +0/-0
    • View Profile
Re: Control EA via command line
« Reply #17 on: June 25, 2021, 08:13:53 pm »
Is there no idea how to solve this?

In my Project I use .NET Framework 4.7.2 but I also tried it with .NET 5.0 and .NET Core 3.1 -> no success. According to the EA documentation it should be possible.

I need this for module testing of modules that need data from EA Repository (modules of an EA-AddIn). If someone has ideas how to test EA-AddIn modules in another way, I'm open to hear them.
« Last Edit: June 25, 2021, 08:16:42 pm by jörg »

adepreter

  • EA User
  • **
  • Posts: 187
  • Karma: +10/-9
    • View Profile
Re: Control EA via command line
« Reply #18 on: June 28, 2021, 04:35:24 am »
You could use the Labnaf PowerShell (https://www.labnaf.one/EndUserMaterial/Labnaf_PowerShell/Labnaf%20PowerShell%20-%20User%20Guide.pdf)

The following features are independent of the modeling language:
 Schedule Command (not only Labnaf PowerShell commands)
 Generate Word, RTF, PDF (there are also templates provided)
 Generate Html (with ability to start email discussion from any diagram on the generated web site)
 Backup To Access File

The following features are designed for the unified Labnaf language
(unified language for driving transformations: https://www.labnaf.one/guidance/index.html?guid=D1744801-D8E6-4715-83DB-DED6C781B191):
 Generate Tabular Report (sophisticated Excel, CSV) from modeled templates
 Import Tabular Report (Excel, CSV)
 Cascaded Value calculation
 Validate and send emails to assigned individuals following configurable rules
 Generate Diagrams from diagram templates
 Generate implicit connectors

www.labnaf.one
« Last Edit: June 28, 2021, 07:27:41 pm by adepreter »