Book a Demo

Author Topic: How to add additional elements to a diagram  (Read 2842 times)

trickster60

  • EA User
  • **
  • Posts: 20
  • Karma: +0/-0
    • View Profile
How to add additional elements to a diagram
« on: December 20, 2011, 11:19:12 am »
HELP PLEASE

I am writing an add-in that in part allows me to create an element via dragging from a toolbar to a diagram and in doing so automatically causing additional elements to also appear in the diagram in question.

I am using the EA_OnPostNewElement to first create a "Port" which I add to the new Element. I want the port to also be displayed in the diagram so I create the necessary new DiagramObject which I update before then refreshing the DiagramObjects collection. Finally I update the diagram itself (the debugger show the additional DiagramObect is in the collection. But on return the diagram only shows the new Element but not the embedded Port. What am I doing wrong?

b.t.w I also notice creating a new element via dragging from the toolbox calls EA_OnPreNewDiagramObject but not EA_OnPostNewDiagramObject. Is this expected behaviour?