Book a Demo

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - OJB

Pages: [1]
1
Hi  :)

I'm working with Sparx Model Add-Ins to provide some automation and "GUI extension" to the Sparx EA client.
I assume with Model Add-Ins the already existing Add-In concept is replicated so that I could use the existing reference e.g. for event handling
to execute certain actions after the user switched between diagrams I use the event EA_OnTabChanged which is defined here:https://sparxsystems.com/enterprise_architect_user_guide/17.1/add-ins___scripting/ea_ontabchanged.html
The event provides 3 parameters:
Code: [Select]
Repository (EA.Repository), TabName (String) and DiagramID (Long) - but this doesn't seem to be the case. When I try to output TabName or DiagramID with Session.Output or Repository.WriteOutput TabName and DiagramID are shown as [object Object]
With other events like EA_MenuClick this works fine (e.g. for the String ItemName)
I'm working with Sparx EA V16.1.1628

The example model doesn't cover EA_OnTabChanged, so I hope that I can find some help how to solve this here  :)

Happy Halloween,
Oliver

2
@Geert I used v17.1.1712 (no changes regarding diagram saves since then, according to the release notes)
Did you use 32bit oder 64bit?

BR, Oliver
I did the test with both. No difference.

Geert

Thanks a lot!
BR, Oliver

3
@Geert I used v17.1.1712 (no changes regarding diagram saves since then, according to the release notes)
Did you use 32bit oder 64bit?

BR, Oliver

4
Thanks Takeshi and Geert for the fast replies  :)

@Takeshi: I will look into the snapshot feature - I wasn't aware of that - it might even get handy for me, because I already built a similar routine for diagram snapshots to use them in overview diagram setting with hyperlinks from the image to the diagram itself - but my first version is slow because I had to use a lot of file handling (exporting png, zipping around, converting to hex and pushing it back into the database  ;D)
I had a quick look and found some information, but I wasn't able to find where to set the switch. Could you provide me some further guidance please?

@Geert: What was your version for V17 and was the automatic snapshot feature Takeshi mentioned set to off?

BR, Oliver


5
Hi There  :)

I'm new to this forum and asking for help. I used the great content here in the past "passively" to learn Sparx EA automation.
Over time I created an extensive JavaScript library mainly focussing on diagram generation automation. I tried to achieve near-real-time response times and encountered a problem while testing V17.1 64 bit (currently using V16.1 32 bit) - with qea/SQLite databases

I have to start many automations by saving the current diagram (Repository.SaveDiagram()) to not lose user changes. With version V16 this takes about 0,1s for standard diagrams - with version V17 it is 0,8-1s (even for completely unchanged diagrams) which is a huge impact when mostly save and reload are the time consuming actions and many automations finish (in V16) in a total time below 0,3-0,5s with complex automations. So the save action is 8-10 worse in V17 compared to V16

I created a small script to measure the performance and I hope you could help verifying this behaviour or find a solution.
If you have the same experience would you see this as a bug?

Best regards, Oliver

the test script (for the Script Diagram Group) I used for the tests ...

Code: [Select]
Repository.EnsureOutputVisible("Script")
var curDG = Repository.GetCurrentDiagram()
if (curDG != null){
var start = new Date().getTime()
Repository.SaveDiagram(curDG.DiagramID)
var stop = new Date().getTime()
Repository.WriteOutput("Script", "Time: " + (stop - start) + " ms", 0)
}

Pages: [1]