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 - pdelporte

Pages: [1]
1
Automation Interface, Add-Ins and Tools / Re: SQLQuery
« on: July 10, 2007, 09:15:31 pm »
Hello,

Yes, the Rpository.ConnectionString is exactely what I was looking for. I solved my problem to get a connection to the DB used.

Thx.
Pierre

2
Automation Interface, Add-Ins and Tools / Re: SQLQuery
« on: July 10, 2007, 03:03:26 am »
Sure, you can use ADO, it is not a problem, but what I would like to avoid is to hardcode the connectString. I rather prefer to find a way to retrieve the connectString that EA used. Unfortunately, I do not know how I can do this. I was hoping that the above mentionned SQLQuery would help me.

If needed I can provide an exemple of ADO connection against Oracle.

Yours,
Pierre

3
Automation Interface, Add-Ins and Tools / Re: SQLQuery
« on: July 09, 2007, 10:47:38 pm »
Hello,

I am also intersted in fetching some data from some tables of EA. Could you tell me how to use the SQLQuery function, as I can't find it. A very short exemple of how to use it would be nice.

Regards,
Pierre

4
Great, I found the solution :

Code: [Select]

prj = Repository.GetProjectInterface();
// get the selected package

EA.Diagram diagram = Repository.GetCurrentDiagram();

foreach (EA.DiagramObject dObj in diagram.SelectedObjects)
{
  EA.Element elem = Repository.GetElementByID(dObj.ElementID);
  Console.WriteLine(elem.Name);
                       
}


Thx for the quick help.

Yours,
Pierre

5
I am writing an add-in to be able to change the status of selected elememts in a diagram. I can easly see the number of selected elements, but I cannot get a reference to the selected elements in order to change some of their attributes.

Does anyone know how I can access those elements ?

Code: [Select]

prj = Repository.GetProjectInterface();
// get the selected package

EA.Diagram diagram = Repository.GetCurrentDiagram();

// What type of object should I use instead of Object obj ?
foreach (Object obj in diagram.SelectedObjects)
{
  // the following convetion does not work !!!
  EA.Element elem = (EA.Element)obj;
  Console.WriteLine(elem.Name);
                       
}


Thx,
Pierre

Pages: [1]