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

Pages: [1]
1
I'm using Build 834. Is this build more bug-prone than others?

I can successfully retrieve all objects in the collection and read their attributes. I can also add new parameter into the collection using AddNew method. On the other hand I can't update content of the objects and can't delete any of these.

I'll give it one more try and probably send a bug report as you suggested.

Thank you for your help.

2
Hi David,

I tried the DeleteAt method with Boolean parameter set to False but this doesn't work either.

The only difference now is the error message which reads: ""System.Runtime.InteropServices.COMException"

The exception message is empty string in both cases.

3
Hi PV,

thanks for your reply.

I tried your idea, unfortunately it doesn't solve my problem.
Problem is the program crashes in the first loop even with index = 0 .

4
I tried to iterate downwards but the result is still the same - exception thrown.

My method now looks like this:
Code: [Select]

        public void DeleteParameters(EA.Method _methodObject)
        {  
            int i;
            for (i = _methodObject.Parameters.Count - 1; i >= 0; i--)
            {
                _methodObject.Parameters.Delete((short)i);
            }
            _methodObject.Parameters.Refresh();
        }
      

The exception is thrown by statement: _methodObject.Parameters.Delete((short)i);
when it is run for the first time.

5
Yes, I've already tried that. I'm using C#, so here is my code:

Code: [Select]
EA.Method _method;
          EA.Collection l_ParamCol;
          l_ParamCol = _method.Parameters;
          
          for (short i = 0; i < l_ParamCol.Count - 1; i++)
          {
                _method.Parameters.Delete(i);
              
          }
          _method.Parameters.Refresh();

l_ParamCol.Count = 5 but the result is an error message: "EA_MenuClick: External Component has thrown an exception"



6
Hi all,

I've been dealing the problem with Parameters collection of an EA.Method class.

Main purpose of my add-in is to create a new class diagram using the information inserted by a user into the add-in form.

I've created a new class diagram, put some class and interface objects into it, and put a few methods into the classes using my add-in.

The problem appears when I'm trying to fill the Parameters collections of these methods. In this moment the Parameters collection already contains some parameters, added in the previous run of the add-in.

Is there a way to empty this collection so I can use my add-in properly?

Thanks all for help.

7
Hi all,

I'd like my add-in to work with the selected diagrams only.
I'm using C#, so I tried something like this:

EA.Package = ...
foreach (EA.Diagram diagram in package.Diagrams)
{    
      if (diagram.SelectedObjects.Count > 0)
      {.....


But when there is no diagram selected I get an error message saying that I cannot do .SelectedObjects.Count on hidden diagrams.

Is there a way to find out whether the diagram is hidden or not?

Thanks a lot.

Pages: [1]