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
511
Automation Interface, Add-Ins and Tools / Adding to Collections
« on: August 22, 2009, 12:03:13 am »
Hi All

In the Object Model Collections (obtained via an Element property) are read only. However new items can be added by using the method AddNew.

When the Collection is refreshed, then the elements in the collection appear to sorted alphabetically by name. (This is also true using the EA GUI interface)

On the EA GUI interface there are Up Hand and Down Hand icons which you can use to modifiy the order of items in a Collection (for example changing the order of scenarios by name rather than alphabetcial)

Can this re-ordering of Collections be achived in the Object model for Add-Ins. If so how?


512
Thanks am I correct in assuming that the path after /d in the last reg entry is the file path to the shared licence store?

513
Automation Interface, Add-Ins and Tools / EA from the Command Line
« on: July 22, 2009, 12:29:32 am »
Hi All

Does anyone know if it is possible to give the filepath of the floating license store as a parameter to ea.exe in much the same way as you can give the filepath of a ea project file?

for example

ea.exe %1 %2

Where %1 is the filepath of the project (or connection string)
and %2 is the filepath of the floating license store

Cheers and thanks

514
I have raised this before and it has always puzzled me. If the transformation process generates properties for public attributes (which are then private) in the Platform Independent Model, they why is the default scope (visibility) for attributes private when the gen langauge is set to <none>

Using this default prevents the transformation process generating the properties for the attributes. The only solution is to modify the transformation scripts, or laboriously go through all attributes changing their scope from private to public and then re-apply the transformation.

I would have thought it be more logical to set the default scope (visibility) for attributes to public when the gen language is set to <none>

This is especially odd since the default scope for a role (linked attributed) is public

515
Thanks and feature request has been submitted.

516
Hi All

I have developed a large UML profile for a client which contains numerous stereotyped elements and assoicated tagged values.

All works just fine.

Is there any way on the UML Profile export/import process to preserve the order of tagged values so that they agree with the order of the attributes of the elements on the UML profile, instead of arranging them alphapbetically as EA does at present?

This occurs when the profile is imported and used in an EA project

Thanks and regards

517
Does anyone know of a method using the Object Model how to obtain the diagram to which a Diagram reference (UML Diagram Element)?

I am looking to obtain either the diagram ID or the diagram GUID

Cheers

518
Automation Interface, Add-Ins and Tools / Re: Cloning a Root Node
« on: May 30, 2009, 12:57:41 am »
It's OK guys I've done, using an MDG, with an MTS containing a <ModelTemplates> section

519
Automation Interface, Add-Ins and Tools / Cloning a Root Node
« on: May 29, 2009, 11:35:02 pm »
Is it possible to clone a project root and its subsequent View/package structure?

If I export a Root, and attempt to re-import into the same project the process fails with a "Root with the samer name already exists" message.

The reason for this is for modelling variations of a model all adhering to a common structure

I would like to be to export the root to xmi and import the xmi into the same project.

How is this achieved?

520
Thanks Simon, a lot easier than the method I discovered!

521
Hi All

I have found the solution, for anyone interested here is the code to copy a formatted string obtained via the EA object model as a property to the Windows Clipboard, so that the formatting is preserved when written to a Word document

        private void copyToClipBoardAsHTML(string text)
        {
            Encoding enc = Encoding.UTF8;

            string begin = "Version:0.9\r\nStartHTML:{0:000000}\r\nEndHTML:{1:000000}"
                           + "\r\nStartFragment:{2:000000}\r\nEndFragment:{3:000000}\r\n";

            string htmlBegin = "<html>\r\n<head>\r\n"
               + "<meta http-equiv=\"Content-Type\""
               + " content=\"text/html; charset=" + enc.WebName + "\">\r\n"
               + "<title>HTML clipboard</title>\r\n</head>\r\n<body>\r\n"
               + "<!--StartFragment-->";

            string htmlEnd = "<!--EndFragment-->\r\n</body>\r\n</html>\r\n";

            string beginSample = String.Format(begin, 0, 0, 0, 0);

            int countBegin = enc.GetByteCount(beginSample);
            int countHTMLBegin = enc.GetByteCount(htmlBegin);
            int countHTML = enc.GetByteCount(text);
            int countHTMLEnd = enc.GetByteCount(htmlEnd);

            string htmlTotal = String.Format(
                begin,
                countBegin,
                countBegin + countHTMLBegin + countHTML + countHTMLEnd,
                countBegin + countHTMLBegin,
                countBegin + countHTMLBegin + countHTML) + htmlBegin + text + htmlEnd;
            DataObject obj = new DataObject();
            obj.SetData(DataFormats.Html, new System.IO.MemoryStream(
                enc.GetBytes(htmlTotal)));
            Clipboard.SetDataObject(obj, true);
        }

Cheers

522
Hi All

I am developing an add-in which produces customized documentation in Word using the EA object model and MS Word Interop.

Output into Word of the Notes property of an element is easy as below

Range.InsertAfter(element.Notes);

However, if the Notes field contains RTF formatting, the output appears similar to below:

This group of users has access to <font color="#ff0000"><b><i>all</i></b></font><b><i> </i></b>functionality of the application

Copying and Pasting directly from the element property dialog into Word works just fine, preserving all the formatting.

But using the Windows clipboard as:

Clipboard.SetText(element.Notes, TextDataFormat.Rtf);
Range.Paste();

Outputs the text as if the notes were written directly (ie with the tags)

Using the below produces a Word error, persumably since the Html is incomplete (no <html><body> tags):

Clipboard.SetText(element.Notes, TextDataFormat.Html);
Range.Paste();

Adding the missing <html><body> ... </body></html> stiil produces a word error.

Does anyone know:

1) How to get the notes property form an element with ALL the formatting so that it will output/paste correctly?

OR

2) How to copy/paste elemen.Notes so as to preserve the formatting?

Cheers

523
Automation Interface, Add-Ins and Tools / DualCollection vs Collection
« on: January 27, 2009, 10:43:08 pm »
Simple question, what is the difference between EA.IDualCollection and EA.Collection?

When would you use one over the other?

My Add-In uses EA.IDualCollection at the momment and works fine, but I would like to see a formal definition.

I believe there is also EA.IDualElement and EA.Element, so on a more generic level what is the difference between EA.IDualx and EA.x?

Cheers

524
Automation Interface, Add-Ins and Tools / Re-connection of a Connector
« on: November 27, 2008, 03:10:21 am »
Hi All

I am working on an add-in that deals with connectors and I need to detect if a connector is being re-connected using the dragging to a new element method.

My add-in is registered to receive the event EA_OnNotifyContextItemModified and at the momment, I simply display a simple dialog capturing the connector GUID, names of the elements using clientId and supplierID as shown in the code below:

public void EA_OnNotifyContextItemModified(EA.Repository Repository, string GUID, EA.ObjectType type)
        {

            if (type.ToString() == "otConnector")
            {
                EA.IDualConnector theConnector = Repository.GetConnectorByGuid(GUID);
                string[] details = new string[3];
                int clientID = theConnector.ClientID;
                int supplierID = theConnector.SupplierID;
                details[0] = "client : " + Repository.GetElementByID(clientID).Name;
                details[1] = "supplier : " + Repository.GetElementByID(supplierID).Name;
                details[2] = "connector GUID : " + GUID;
                debugForm = new DebugForm(details);
                debugForm.Text += " : Modified";
                debugForm.ShowDialog();
            }
        }

All works well, when I move a connector which starts at Element A (the client) from its supplier (Element B) to a new supplier (Element C), the event is captured twice.

This I would expect since the connector is being disconnected and re-connected (two changes), but the client and supplier info is the same in both events. Specifically, only the new supplier info is shown.

Is there any method of detecting the original supplierID and the new supplierID when a connector is moved in this manner?

Hope what I seeking to do is clear in the above

Cheers

525
Hi David

Thanks, that confirms what I had suspected ... but it is always good to pose the questions in case there any hidden gems

Cheers
Phil

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