Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: mrtotov on February 13, 2009, 01:22:16 am

Title: Connection between DiagramObject and Element
Post by: mrtotov on February 13, 2009, 01:22:16 am
Hi. I have to compare the elements contents in a diagram with the elements of the package. For example, if I create a class in a package, and after that I insert the same class in a diagram "as Simple Link", there is no problem, because the ElementID of the Element is the same of the DiagramObject. But if I choose to insert the class "as Instance of Element",  I can't match a connection between this two objects. (My final purpose is to check that all the classes included in a Sequence diagram are in the Class Diagram too, so I must find a property that connect the elements of the two diagrams).
Thanks.
Title: Re: Connection between DiagramObject and Element
Post by: «Midnight» on February 13, 2009, 06:29:13 am
It sounds like you are disconnecting because an Object is only an instance of the Class it belongs to. You need to retrieve the Element (via ElementID) for each object. After ensuring that each is indeed an Object, the ClassifierID attribute of each points to the Class itself. If these pointers are the same you should have your answer.