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

Pages: [1] 2 3 4
1
So there is no way to do it from the Builder/SQL or Repository.SQLQuery() from the API?

I guess I just have to loop through the packages by code and then perform
SELECT * FROM t_object WHERE Object_Type = 'Class' AND t_object.Package_ID = <ID>
on each package then.

2
SELECT * FROM t_object
WHERE Object_Type = 'Class'
AND Package_ID in (#Branch#)

I run this from Find In Project/Builder/SQL and get the following error:

"Microsoft OLE DB Provider for ODBC Drivers. [MySQL] [ODBC 5.3(a) Driver][mysqld-5.5.27-log] You have an error in your SQL syntax; check the manual that corresponds to you MySQL server version for the right syntax to use near '' at line 3"


3
I'm trying to get all the Elements with object type "Class" within a single project root.

However the following SQL query finds the elements from every project root within my project.

SELECT * FROM t_object WHERE Object_Type = 'Class'

Couldn't find a solution in the documentation.

4
Hi

How can I get the name of the project and the logged in user using c# and interop.EA?

5
General Board / Re: Customise the tool tip for my stereotypes?
« on: September 16, 2014, 03:55:21 pm »
I agree with Jayson!
A handle where you can customize tooltips would be really nice. I also searched the net to find a solution for it before I posted a question here and found out that it can't be done atm.
So a general handle to customize tooltips got my vote and not just for the stereotypes but for every tooltip in EA.

6
Bugs and Issues / Re: Deleted taggedvalue is still available in the
« on: March 05, 2015, 11:28:40 pm »
Doh!

I guess I will just delete this topic..

7
Bugs and Issues / Deleted taggedvalue is still available in the API
« on: March 05, 2015, 10:46:49 pm »
A deleted taggedvalue was still available/visible in the API but not in EA.

I got an element with the following taggedvalues (from properties in EA):
Name: Something::SomeTaggedValue1 ; Value: 1;
Name: Something::SomeTaggedValue 2; Value: 2;

I created this little test method see below and got the following result from the same element:
Name: Something::SomeTaggedValue1 ; Value: 1;
Name: Something::SomeTaggedValue2; Value: 2;
Name: Something::SomeTaggedValue1; Value: ;
Name: Something::SomeTaggedValue1; Value: ;

        public void showTaggedValuesOfElement(Repository repository)
        {
            string message = "";

            Object item;
            ObjectType ot = repository.GetTreeSelectedItem(out item);

            if (ot == ObjectType.otElement)
            {
                Element elm = (EA.Element)item;
                foreach (TaggedValue tv in elm.TaggedValues)
                {
                    message += "Name: " + tv.Name + ", Value: " + tv.Value + "\r\n";
                }
            }

            MessageBox.Show(message);
        }

So I guess that the two extra taggedvalues must have been deleted earlier.
Does any of you know anything about this?

8
Bugs and Issues / Re: TaggedValues for connectors - bug in API
« on: November 11, 2014, 06:03:04 pm »
Quote
Quote
EXCEPTION:
Unable to cast COM object of type 'System.__ComObject' to interface type 'EA.TaggedValue'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{EF08950B-949E-435F-84A3-A59E3106C3BF}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
That's because the class you need to use is EA.ConnectorTag, not EA.TaggedValue.
Ty Simon. That was the problem. Didn't realize that the API had different ways to access the taggedValues. But as I can see the same thing applies for methods, attributes and so.

9
Bugs and Issues / Re: TaggedValues for connectors - bug in API
« on: November 10, 2014, 11:56:32 pm »
Could this be because of some dll it hasn't registered correctly? I can loop through the taggedvalues of packages and elements but not from the connectors...
This is weird.

10
Bugs and Issues / Re: TaggedValues for connectors - bug in API
« on: November 10, 2014, 09:47:58 pm »
Did you have a taggedValue added to the connector cause that's the only case I get the error?
If I haven't added a taggedValue to the connector it doesn't throw the error while I loop through them.

11
Bugs and Issues / TaggedValues for connectors - bug in API
« on: November 10, 2014, 08:57:48 pm »
I've come to this problem which I think is a bug in the EA API.

EA has the ability to add a taggedValue to a connector. This is done in the properties of the connector (Same for elements and so).

However if I add a taggedvalue to a connector and then loops through the taggedValues for the connector in the API it throws an exception (see below).

foreach (TaggedValue tv in connector.TaggedValues)
{
      //Do something
}

But if there is no taggedvalue in the connector it doesn't throw an exception. So I can't access the taggedValues of the connector from the API which might be a bug.

Using EA v.10 and visual studio 10.

EXCEPTION:
Unable to cast COM object of type 'System.__ComObject' to interface type 'EA.TaggedValue'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{EF08950B-949E-435F-84A3-A59E3106C3BF}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

12
Hi

I'm writing a c# add-in to Enterprise Architect v. 10 and got stuck on a problem trying to pull out hyperlinks from notes fields (in the property dialog of an element or diagram, not the Note element).

So lets say I wrote the following in the notes field:
"Something something... Wooops a <hyperlink>. And then something something".

The hyperlink could refer to another element without having a connector bound to it. Is it possible to programmatically find this hyperlink?

13
I've got the following code which creates a new EA Model and a subpackage to that model. However it seems like the subpackage is only updated/created "visually" - by that I mean that I can see it in EA but if I try to get the packages of my new root it returns 0 which should be 1.

            var root = eaRepo.Models.AddNew("A New Root", "");
             root.Update ();
            eaRepo.Models.Refresh();

            Package newPackage = root.Packages.AddNew("New Package", "Package");
            newPackage.Update();
            eaRepo.Models.Refresh();

            var packages = root.Packages.Count; //Returns 0 but I just created one

Any suggestions on why this doesn't work?

14
I'm trying to add an Element to a newly created package from code.

My code is as following and it breaks at the Element AddNew and throws an error saying "Invalid Type".

                    packageName = "Requirements";
                    Package requirementPackage = parentpackage.Packages.AddNew(packageName, "Package");
                    requirementPackage.Update();

                    if (requirementPackage != null)
                    {
                        foreach (string elementName in ElementList)
                        {
                            Element myElement = requirementPackage.Elements.AddNew(elementName, "Element"); //Breaks here
                            myElement.Update();
                        }
                    }

Creating the package is no problem but that other error doesn't make sense to me.
Have I misunderstood something?

15
Okay so I solved the problem!

And it was nothing near what I thought it was...

My feature was parsing through elements and I had a LastElement attribute to keep track of the latest parsed element. However I had initialized the LastElement attribute to new Element(); - so I was constructing an EA interface during the construction of the AddIn which caused the dll to be broken - EA doesn't like that.

Pages: [1] 2 3 4