Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Julian O

Pages: [1]
1
Yes it does also not work for me. Funny thing is the RTF-Report works with an empty GUID.

Code: [Select]
EA.Project project = Repository.GetProjectInterface();
project.RunHTMLReport("", "C:\\Temp\\EA_Export\\", "PNG", "<default>", ".html"); //does not work with "" nor Guid.Empty.ToString()
project.RunReport(Guid.Empty.ToString(), "<default>", "C:\\Temp\\EA_Export\\export.rtf"); //works with "" as well as Guid.Empty.ToString()

2
There is no way to change the values directly through the API but EA stores so much settings in the registry, also the status of every MDG-Technology in the Key:
Code: [Select]
HKEY_CURRENT_USER\Software\Sparx Systems\EA400\EA\OPTIONS\MDG_TECHNOLOGY_STATUSI haven't tested the behavior of this, but I have done it for some other settings. Sometimes EA reads the registry keys on startup (which would require a restart after change) and sometimes it reads them before a specific action.

Maybe you can work with that :)

3
Oh seems like I overlooked this bit. Thank you very much. I will try it out :)

// Edit: But wait. Isn't the API in the "Interop.EA.dll"? And I checked, this dll doesn't have a new version number, so I thought nothing changed. Or are the Events handled differently and this dll is just for the Object Models?

// Edit2: Works like a charm. :) Thank you very much.

4
In the "Release Notes for 13.0 Beta Build 1301" is following line written:

Quote
"Add-in menus can be added to the category of their choice"

And I have seen an "Add-Ins" Group in the categories "Code" and "Extend". But my Add-in always shows up in the "Extend" category. And if I interpret this line in the release notes correctly, I should be able to define where my add-in shows up, right?
So how would I do this or am I misunderstanding the release notes? I did not find anymore information's on this topic.

Also another thing. In the new version my Add-in does not work with "Alt"-shortcuts. The defined menu-strings with "-&Add-in" would not work and does not show a highlighted Key for using Alt-shortcuts. Do I need another prefix to get it to work or is this simply a bug in the new version?

Regards
Julian

5
Okay, because I don't like just storing all Diagrams upon exporting one package i have implement a method to just save all diagrams in the specified package. Here is what it looks like:

Code: [Select]
    /// <summary>
    /// Saves all Diagrams inside the given Package
    /// </summary>
    /// <param name="i_oPackage">The Package to search for Diagrams</param>
    /// <param name="Repository">The EA Repository</param>
    public static void SaveAllDiagrams(this EA.IDualPackage i_oPackage, EA.Repository Repository)
    {
      // Save all Diagrams in the current Package
      foreach (EA.IDualDiagram oDiagram in i_oPackage.Diagrams)
      {
        Repository.SaveDiagram(oDiagram.DiagramID);
      }

      // Diagrams can also be in Elements
      foreach (EA.IDualElement oElement in i_oPackage.Elements)
      {
        oElement.SaveAllDiagrams(Repository);
      }

      // Go recursively through all Packages
      foreach (EA.IDualPackage oPackage in i_oPackage.Packages)
      {
        oPackage.SaveAllDiagrams(Repository);
      }
    }

    /// <summary>
    /// Saves all Diagrams inside the given Element
    /// </summary>
    /// <param name="i_oElement">The Element to search for Diagrams</param>
    /// <param name="Repository">The EA Repository</param>
    public static void SaveAllDiagrams(this EA.IDualElement i_oElement, EA.Repository Repository)
    {
      // Save all Diagrams in the current Element
      foreach (EA.IDualDiagram oDiagram in i_oElement.Diagrams)
      {
        Repository.SaveDiagram(oDiagram.DiagramID);
      }
    }

6
Thank you both very much for your responses (and Uffe for the further explanation).
I will check that option to just save all diagrams but i think that would be an appropriate workaround.

Thanks. :)

7
Good day everyone

In my C# Add-in i'm calling the EA.IDualPackage.ExportPackageXMI() method with all its arguments. This method has a string return value but after my testing the string is always empty.

Now to the real problem. The method mentioned above pops-up a dialog if the current package has some unsaved elements inside and asks if it should proceed with this unsaved elements or abort the import. Usally the export should be aborted. And since i'm calling an external application after it has exported i would also not execute if it wasn't exported.

I tried getting information about Diagrams and if they have unsaved changes, but i'm out of luck with the EA-API as far as i see it. But maybe one of you has already had a similar case and managed to find a solution. Maybe by directly executing a SQL-Query?
Is there a way to find if a package or it's diagrams are in a unsaved state?

Thank you very much for your help :)

8
I don't know if it just was a coincidence or the magic of the forum, but I just heard back regarding one of my Bug-reports :)

// edit: And with this I mean that I got the reference number at least.

9
Thank you for your fast reply.

I will do so. Unfortunately I don't think much will happen with a bug report. I already sent some bug reports over the last year, never even got a response  :-\

10
I am currently on an C# Add-in to import source files (C++) into Enterprise Architect. And my goal is to automate this process as much as possible.

So in order to achieve this I'm calling 'ImportDirectory(...)"-Function on 'Repository.GetProjectInterface();'. When I do this it all imports as expected and if macros are found in code it throws parsing errors. All good.

Now I have to use the 'ImportFile(...)'-Function on the same ProjectInterface, because i need to create some packages first and then import this files into separate packages. And this almost works. The only problem now is if I try to import source code with unknown macros, I expect to get parsing errors or at least retrieve the information somehow. Unfortunately the Import-Function for files does not automatically show a Dialog if an error was found (it only returns false). I tried to get the error message with the 'Repository.GetProjectInterface().GetLastError();'. This does return an empty string.

Is there a way to get the same information about the parsing error as 'ImportDirectory' shows in the dialog?

Really appreciate your help and if you need more information please tell me and I will add missing parts.

Pages: [1]