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

Pages: 1 ... 33 34 [35] 36 37 38
511
Automation Interface, Add-Ins and Tools / Re: Hide Diagram Note Element
« on: January 29, 2011, 02:09:05 am »
Here's my suggestion, assuming you are using version 8

Use diagram filters to elements, this works the opposite way round to your first think!

I am not sure how you add your notes, but the following is how you would hide a Note Element and a Text Element (both added from the Coomon toolbox)

1) Open up the Diagram Filters view
2) Create a filter which selects elements whose object type is One Of every object type EXCEPT NOTE and TEXT
3) Set the Filter option to Hide from the DropDown list
4) Check the filter on, and you should see all the Notes/Text dissapear

Then when you create your documentation the diagram will print without the notes (confirmed by Print Preview)

In step 2), use the ... button to select all element types and then unselect NOTE and TEXT

If you are using just one note type then the filter is just a simple object type not equals

I am not sure if there is an API method to apply an existing filter to a diagram, I cannot locate one in the current user guide

Hope this helps

Cheers

Phil

512
Many thanks for the replies, I will try these ideas out when I return the office on Monday

Cheers

Phil

513
Hi All,

How do you remove a connector from an element. I have tried using the Delete and DeleteAt methods followed by a Refresh for the Elements's connectors collection.

Examine the size of the collection confirms that something has in fact been deleted, but examination of the Element's propery dialog Links tab shows the connector to still be there!

It is also present on all diagrams where this element is present.

Do I also have to remove the connector from the Diagram's DiagramLinks collection as well?

The code examples in the User Guide show the creation of a new connector (no diagram is necessary), but do not show the removal of a connector.

Any advice will be most appreciated

Cheers

Phil

514
Automation Interface, Add-Ins and Tools / Re: Interfaces (IDual vs I)
« on: January 11, 2011, 08:56:30 pm »
Thanks Alistair, that clarifies it for me I use C# and so will continue to use the IDual

Thanks again

Phil

515
Automation Interface, Add-Ins and Tools / Interfaces (IDual vs I)
« on: January 11, 2011, 04:05:52 am »
Hi All

Probably a question directed at the Sparxians, but in the object model API the Interfaces appear to be duplicated, IDualElement, IElement, IDualCollection, ICollection etc

Is there any fundamental difference between the IDual version and the I version?

If not why are both supplied? If there is what is the difference and when should each be used?

If have written Add-ins using IDual and I have written Add-ins using I, and I cannot see any noticable difference

Any thoughts?

516
Automation Interface, Add-Ins and Tools / Re: requirements trace
« on: December 14, 2010, 03:10:49 am »
Hi

Assuming that you wish to start at an element and then identify the requirements realised by an element, then the following would work

public ArrayList getAllRequirements(EA.IDualElement useCase)
        {
            // Get the connectors for this use case
            EA.IDualCollection connectors = useCase.Connectors;

            ArrayList requirements = new ArrayList();

            // iterate the connectors looking for realizations and add the
            // requirement which it is the supplier to the ArrayList

            foreach (EA.IDualConnector connector in connectors)
            {
                if (connector.Type == "Realisation")
                {
                    EA.IDualElement common = currentModel.GetElementByID(connector.SupplierID);
                    if (common.Type == "Requirement")
                    {
                        requirements.Add(common);
                    }
                }
            }
            return requirements;
        }


Where currentModel is an instance of an EA.Repository class

The above code template could be adapted for, beginning at a Requirements then returning all elements realising that requirement, something, like this:

public ArrayList getAllRealisingElements(EA.IDualElement requirement)
        {
            // Get the connectors for this requirement
            EA.IDualCollection connectors = requirement.Connectors;

            ArrayList realisers = new ArrayList();

            // iterate the connectors looking for realizations and add the
            // element which it is the client to the ArrayList

            foreach (EA.IDualConnector connector in connectors)
            {
                if (connector.Type == "Realisation")
                {
                    EA.IDualElement common = currentModel.GetElementByID(connector.ClientID);
                    requirements.Add(common);
                }
            }
            return requirements;
        }


Cheers

Phil


Phil

517
The query

SELECT DISTINCT ProductName FROM t_datatypes WHERE Type='Code'

works, but only returns a subset of the languages  :-[

That is

C#
C++
Delphi
Java
PHP
VBNet
Visual Basic

this is despite that fact that I have the Ultimate licence

I have found that the MDG Technologies appear to update the t-datatypes table upon loading, so I would expect to see languages like ADA for example. This is clear from the underlying XML since you can add your own language to the list by using an MDG

So where are these datatypes going?

518
Thanks Geert I did find the t_complexitytypes about 15 mins after my post, but thanks for the info regarding the windows registry setting

I will give the t_datatypes query a go,

Thnaks again

519
Hi All

I have a need in an Add-In to obtain the current repository values for the following:

Complexity
Status
Language

I can obtain the values in Status by using the Repository method GetReferenceList("Status")

However what about the other two?

Yes I could "hard code" the values, but I am seeking a more elegant solution where I can obtain the Language settings (as shown in the code generation toolbar) directly from the repository, similarly with the Complexity.

If this is not possible, is there a way I can detect if the user has set the "Extend Complexity" option on?

This would allow me to use one of two "hard coded" settings if obtaining the values directly is not possible.

I have checked the EA version 8.0 User Guide and have examined the Enumerations but cannot find what I require there

Any suggestions?

Cheers

Phil

520
Many many thanks for all the replies, most helpful!

Cheers

521
Hi All

Does anyone know how a symbol can be drawn in front of the text present in a label in a shapescript?

The effect I am after is similar to the "reading direction" black triangle for an association.

There appears to be no way to affect the text position, I can get the symbol, but the text is placed on top rather than alongside

Cheers

522
Automation Interface, Add-Ins and Tools / Re: MDG's SysML Add-In
« on: September 17, 2010, 06:35:24 pm »
EA's built in SysML 1.1 is more or less SysML compliant. I use it occasionally, but I have noticed that you cannot display a Parts compartment within a Block element for example (you can in the MDG SysML 1.0 version)

There are other similar compartments defined in the SysML which again are not supported by Sparx

Because a Requirement element is already in EA, SysML uses the same element and hence its appearance differs from that defined in SysML.

Apart from this minor niggles, I find the SysML 1.1 works just fine. (The simulation of then parametric diagrams is a little limited however)

Cheers

Phil

523
Hi Guys

Problem solved, the query was changed to

queryResult = repository.SQLQuery(@"SELECT UserLogin, FirstName, Surname FROM t_secuser " +
                              @"WHERE USERID = '" + userID.InnerText + "'");

That is not using * in the SELECT and all is fine now

Cheers

Phil

524
Thanks Guys for the replies, the situation breifly is:

I am modifying an Add-In for a client that is going to work on shared models, and will be doing fancy things with profiles and tagged values (synchnronising tagged values is just one of them).

They use "require lock for edit", so before updating a list of elements I need to check the lock status, and only work on unlocked or locked for the current user elements.

The discovery of whether locks have been applied is easy and works fine. The problem (the error message) occurs on the following query

queryResult = String.Empty;
queryResult = repository.SQLQuery(@"SELECT * FROM t_secuser " +
                              @"WHERE USERID = '" + userID.InnerText + "'");

Which is taking a userID from the first query XML result and discovering the user name etc

The query above does work and does retrieve the correct results.

For testing I have created a small test EA file which is a shared model, with security enabled. The users  defined are the default admin and another called Phil, who is a member of the Adminstrators group

When running the add-in logged in as Phil, all is fine ... correct results are obtained and no error. However repeating the process logged in as admin, produces the correct results, but the error message occurs when looking up Phil.

Cheers

525
Hi All

Does anyone out there know the meaning and cause of the following message appearing in an Add-In?

Error:
Code = 0x0
Source - Line : 0; Char : 0;
Error Description = (null)

It is appearing after executing the command

Repository.SqlQuery

The query does in fact return the correct the result, but the error dialog is incredibly annoying and I cannot make it go away! :-[

Cheers

Phil

Pages: 1 ... 33 34 [35] 36 37 38