6

I have managed to open my EA project via the automation API, but don't know the right format in which to pass the arguments to the ImportDirectory(…) method:

var repo = new EA.RepositoryClass();
repo.OpenFile("some.eap");
var proj = repo.GetProjectInterface();

string language = "...";      // what to put here for C#?
string extraoptions = "...";  // what to put here for my option (see below)
proj.ImportDirectory("{C5007706-B7DA-4ACC-9123-F934F9B60305}", language, "C:\somedir", extraoptions);

When doing the import manually I select the following options in EA's Import Source Directory window:

  • C# as programming language
  • recursively process subdirectories is checked
  • Create logical diagram for each package is unchecked
  • Import defined components is unchecked and greyed-out
  • Do not import private members is unchecked
  • Create package per namespace is selected
  • Synchronize existing classes is selected
  • Remove classes not found in code is set to 'always delete'

What is the equivalent translated to string arguments for the ImportDirectory(…) method?

David
  • 2,426
  • 3
  • 24
  • 36
  • 1
    Good question. For language just try `"C#"` and for extraoptions try `"recurse=1"` . The documentation here is over the top... – qwerty_so Apr 19 '16 at 11:33
  • @ThomasKilian The remaining options are what I am mainly unsure about. – David Apr 19 '16 at 13:10
  • Yeah. I might look into that later. You're just on the alternatives "try and error" or "mail Sparx support". In the latter case we'd be grateful to see the response as answer here :-) – qwerty_so Apr 19 '16 at 14:28
  • 1
    You should opt for mail. The help only has "recurse=1;overwrite=1;dir=C:\" as example. Roy is a nice guy, but obviously he's the only one doing documentation. And it's way behind what should be documented. – qwerty_so Apr 19 '16 at 14:43
  • @ThomasKilian Can you guide me to the help where you found the example string? – David Apr 20 '16 at 06:44
  • Somewhere in the help where I entered ImportDirectory. Let me see... Yes. There's just one result. Search for recurse in the text. http://sparxsystems.com/enterprise_architect_user_guide/12.1/automation_and_scripting/project_2.html – qwerty_so Apr 20 '16 at 08:44
  • @ThomasKilian However the example refers to the `GeneratePackage` method. But if there should be multiple extra options for `ImportDirectory` the `;` is the char to separte them, that's what I believe as well. – David Apr 20 '16 at 08:49
  • Yes. They like semicolon as separator. But guessing the keywords is hard. So just mail the support. They usually answer those questions fast. And we'd be happy to read your answer here :-) – qwerty_so Apr 20 '16 at 08:51

1 Answers1

2

EA Support told me that all the values listet in "the Source Type" dropdown on the "Import Source Directory" dialog can be used as arguments for the language parameter. Moreover currently only recursive=1 is supported as argument for the extra options parameter.

David
  • 2,426
  • 3
  • 24
  • 36