Book a Demo

Author Topic: Access a project-path via automation interface  (Read 3517 times)

blue5teel

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Access a project-path via automation interface
« on: November 22, 2008, 01:09:13 am »
Altough i never get any answers to my questions in this forum, i'll give it another try.  :'(

This time i need to access the path or directory of a currently open project or its corresponding eap-file with my C#-addin.
I want to generate a new directory inside the directory, which contains the eap-file.
I want to use this directory as a workingdirectory for my addin.

Does someone have a clue ? I didnt find any poperties or methods in the Repository-class which deal with this topic (for example "Repository.getProjectPath()").  :'(

Thx

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Access a project-path via automation interface
« Reply #1 on: November 22, 2008, 05:57:24 am »
Although I usually don't reply to complaints, I'll give it another try.

When you are working with an EAP file the Repository.ConnectionString will return the file name. You can extract the path or directory from this string via whatever methods you would normally use in C#. I find that the IO.Path namespace provides a fine set of tools.

For future reference, the above method call is documented in the EA help. It is also mentioned in many forum posts, all of which are available via the Search button on every forum page.
No, you can't have it!

blue5teel

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: Access a project-path via automation interface
« Reply #2 on: November 23, 2008, 06:20:00 am »
Oh thank you ...

Well, i searched and searched and didnt find anything.
Could be caused by the fact, that "ConnectionString" is not a very intuitive name for a project-path or a filename.
« Last Edit: November 23, 2008, 06:21:16 am by blue5teel »