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

Pages: [1]
1
Automation Interface, Add-Ins and Tools / Re: Sort the attributes of class
« on: November 22, 2012, 01:31:22 am »
Thanks Geert! You've been very helpful!!

2
Automation Interface, Add-Ins and Tools / Sort the attributes of class
« on: November 21, 2012, 11:20:28 pm »
Hello,

In my add-in, I need to copy all the attributes from class A to class B. However, the order of attributes of B displayed in the diagram is alphabetic rather than the same order of attributes of class A.

Is there a way to display the attributes of class B with the same order as attributes of class A?

Thanks!

3
Automation Interface, Add-Ins and Tools / Attribute: type mapping
« on: December 15, 2012, 12:59:09 am »
Hi,

I have a question on the type mapping of a Attribute of a Class.

As you know, for each Attribute of the Class, we can define the "Type" of the attribute by simply fill in the type string, or choose the type from a model repository tree by clicking on the [...] tab after the "Type" field.

My question is, which property of the "Attribute" class holds the value of the link which mapps the name of the "Type" to the data type that is defined in the model repository?

Thanks!

4
Hi Geert,

You are right, I was doing it in a wrong way... And Repository.AdviseConnectorChange(long ConnectorID) works!

Thanks a lot for your help! ;)

Adam


Quote
Adam,

Look at the documentation for the EA.Collection.Refresh(). It doesn't do what you think it does.

In your case you should use Repository.AdviseConnectorChange (
long ConnectorID) and possibly RefreshOpenDiagrams (
boolean FullReload)

Geert

5
Automation Interface, Add-Ins and Tools / Refreshing the view of Connector
« on: November 19, 2012, 09:16:19 pm »
Hello, I am developing an Add-in, and I had a problem refreshing the view of connector for the role name of the SupplierEnd.

The idea is to change the role name by a given string. However, when I changed the value of the Connector.SupplierEnd.Role, and refresh the connector and the diagram, it doesn't refresh the view but the value has been changed indeed. All I have to do is to double click the connector and click on "OK" to change the view of the name for the role.

What I want is to avoid mannually refreshing the view but doing everything in the automation. The code is as follows, could anyone help me with this? Thanks a lot!

-----------------------------------------------
EA.Connector outputConnector;
outputConnector = (EA.Connector)((EA.Element)outputObject).Connectors.GetAt(0);

outputConnector.SupplierEnd.Role = "ABC";
((dynamic)outputConnector.SupplierEnd).Update();
((dynamic)outputConnector).Update();

package.Elements.Refresh();
package.Diagrams.Refresh();
-----------------------------------------------

Pages: [1]