[Python] Enterprise Architect Python Scripting - Add an element to a Diagram

Discussão em 'Python' iniciado por Stack, Abril 11, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to write a python script so that I can add an element to a diagram in Sparx Enterprise Architect.

    TestDiagEl=TestDiag.DiagramObjects.AddNew("l=10;r=110;t=-20;b=-80","")
    TestDiagEl.ElementID=TestEl.ElementID
    TestDiagEl.Update
    TestDiag.Update
    eaRep.ReloadDiagram(TestDiag.DiagramID)


    It doesn't seem to work, what am I doing wrong?

    EDIT It seems that @geert was right, additionally i didnt add () after Update.

    Continue reading...

Compartilhe esta Página