Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Paolo F Cantoni on June 26, 2009, 04:22:11 pm

Title: Set CustomProperty (in AI)  for Connector Fails
Post by: Paolo F Cantoni on June 26, 2009, 04:22:11 pm
public void SetConnectorCustomProperty(EA.Connector connector, string propertyName, string propertyValue)
{
    EA.CustomProperty oCustomProperty;
    for (short iCustomerPropertyIterator = 0; iCustomerPropertyIterator < connector.CustomProperties.Count; iCustomerPropertyIterator++)
    {
        oCustomProperty = (EA.CustomProperty)connector.CustomProperties.GetAt(iCustomerPropertyIterator);
        if (oCustomProperty.Name == propertyName)
        {
            oCustomProperty.Value = propertyValue;
        }
    }
}

Fails when attempting to set the diagram with a (to me) spurious error:
"EA_MenuClick: Element no longer available"

Anyone know how to set Custom Properties for Connectors?

Reported.
TIA,
Paolo
Title: Re: Set CustomProperty (in AI)  for Connector Fail
Post by: Paolo F Cantoni on July 07, 2009, 11:19:03 am
Update:  Sparx have been able to reproduce and will investigate further.

Paolo
Title: Re: Set CustomProperty (in AI)  for Connector Fails
Post by: Motlib on September 14, 2016, 06:52:17 pm
Hello,

I know the topic is rather old, but did you (or anyone else) find a solution?

Background: I now ran into a very similar problem. When automating EA 10 (build 10.0.1009) I query the CustomProperties collection of a SysML port to get its isConjugated value. I can find the right CustomProperty in the collection (so accessing its .Name is no problem), but when I access its .Value, I get a COM Exception 80020009 Element no longer available.

When trying to reproduce the problem with a very basic EAP file with one SysML block and one port, the problem seems to disappears. But still appears with the model I need to automate.

Thanks and regards,

Motlib
Title: Re: Set CustomProperty (in AI)  for Connector Fails
Post by: Geert Bellekens on September 14, 2016, 07:48:57 pm
Few things to try:

- Run a project integrity check
- Upgrade to the latest version

If the steps above fail to resolve the issue then report a bug (http://sparxsystems.com/support/forms/bug_report.html)

Geert