Book a Demo

Author Topic: Add-in: Get the current directory of the project  (Read 4818 times)

Radiogamer

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Add-in: Get the current directory of the project
« on: September 20, 2016, 07:24:58 pm »
I've managed to construct some add-ins now that exports an Enterprise Architect project to XMI and allows me to continue with this XMI file.
For this I would need to specify the directory this XMI file is to be stored in. This is currently set on the Desktop, and using the FolderBrowsingDialog one can select the desired directory.

What would be more useful is if I can set this default location to the directory the EA project is located. Setting this default location in my add-in is easy, but I would need to get this directory first. Hence my question: Is it possible to obtain the directory as string of the currently opened project? I've looked into the user guide and API, but I haven't found anything yet that allows me to get the directory.

Thanks in advance.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Add-in: Get the current directory of the project
« Reply #1 on: September 20, 2016, 07:27:06 pm »
If it is a .eap file you can use Repository.ConnectionString

Geert

Radiogamer

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Add-in: Get the current directory of the project
« Reply #2 on: September 20, 2016, 07:48:29 pm »
That's a sneaky way to have the location being part of the repository. Thanks for helping me out again  :)