Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: rayt on November 21, 2013, 02:22:33 am
-
Hello,
making a simple call to update() on the diagram object of a structural element moves the box to (0,0) inside its parent - this was working in EA 9, but appears broken in EA 10.
can anyone reproduce this or maybe have a workaround?
thanks,
ray
Here is some code to reproduce the effect. Apparently it works with normal elements, but not with structural elements.
OnProjectBrowserScript();
function OnProjectBrowserScript()
{
var theDiagram as EA.Diagram;
theDiagram = Repository.GetTreeSelectedObject();
for(var i = 0, maxi = theDiagram.DiagramObjects.Count; i < maxi; i++) {
var dob as EA.DiagramObject;
dob = theDiagram.DiagramObjects.GetAt(i);
dob.Update();
}
theDiagram.Update();
}
-
Might be connected to a broken placement of embedded elements in V10 which worked in 9.3. I have reported this a while ago after one reader of my Scripting book noticed that the example did not work in V10.
You should report this as a bug. That might shorten the time to fix...
q.
P.S. The final Diagram.Update is superfluous.
-
Thanks for your reply, I'll report a bug.
Btw this only happens when the diagram is not visible in a window, so caling Repository.OpenDiagram(theDiagram.DiagramID); before the update is an (ugly) workarond.
-
indeed know issue, fix scheduled for ea11
ray