Book a Demo

Author Topic: Issus on Property Types API  (Read 3306 times)

mv01d

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Issus on Property Types API
« on: February 24, 2014, 09:09:09 pm »
  • Adding a new Property Type with the following code
Code: [Select]
var obj = repository.PropertyTypes.AddNew(propertyName, "<memo>");

if (obj != null)
{
      type = obj as EA.PropertyType;
      type.Detail = "Type=AddinBroadcast;";
      type.Update();
}

Does not refresh the repository correctly. The new Propery does not triggers a EA_OnConnectorTagEdit call until a re-open of the project. (Tested: EA10 and EA11 beta)


  • The call EA.Repository.PropertyTypes.GetByName(...) leads to the Exception:
Code: [Select]
System.Runtime.InteropServices.COMException (0x80040002): Action is not supported
  bei EA.CollectionClass.GetByName(String Name)
(Tested: EA10 and EA11 beta)
[/list]

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Issus on Property Types API
« Reply #1 on: February 24, 2014, 11:12:31 pm »
I just ran that code and it worked with no issues.

Why should it trigger EA_OnConnectorTagEdit? It is not a new tag, but just a template. And that was entered correctly.

q.

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: Issus on Property Types API
« Reply #2 on: February 25, 2014, 09:19:09 am »
I would not expect adding a new Property type (via automation or the GUI) to trigger EA_OnConnectorTagEdit at all.  That event seems completely unrelated as far as I understand it.

The GetByName function is only supported for use on specific Collections (Model, Package, Element, Diagram, and element TaggedValue).  See:
http://www.sparxsystems.com/enterprise_architect_user_guide/10/automation_and_scripting/collection.html