Hello all,
I am developing a report for changing the position of object occurrences in a model. At the report's core all I have is a loop that calls SetPosition for each occurrence.
for each occ in model: ... calculate x and y ... occ.SetPosition(x, y) ...
I run the report with model closed, to assure occurrence positions can be changed successfully.
However, when I open the model inside Designer after running the report, occurrence positions have not changed. What I find odd is that internally, occurrence positions are being set! I have spent many hours debugging and experimenting with simple cases and still can't find why the model graphics aren't being updated.
Is there is some kind of model layout cache that is not being updated after the new positions are set using occurrence.SetPosition()?
I am using ARIS 7.0.2., is this a known bug..?
Thanks
Hi Kyle,
there is no such bug known.
- Do you do anything else in your report? Do you maybe set the flag "LAYOUT_ON_OPEN"?
- What is the return value (boolean) of SetPosition? If true is returned, the position should be stored correctly
BR,
Torsten
Hello and thanks for your quick reply.
Regarding interactions with the model, my report only queries occs and connections (OccList/CxnList) and sets occurrence positions.
The SetPosition() returns true and the position is in fact changed, that's the odd part...! However, when I open the model in designer... the layout stays the same.
I'm not setting any flags. More, I have never messed up with model flags. However I'm going to investigate that further.
Maybe it's relevant to say all the models I'm trying to modify with the report are being created also using reports. Everything from model creation to occurrence and connection creation is automated. When I open one of the models it's already using the default layout.
Here is my workaround to the problem:
1. create a macro that opens, saves and closes a model, in this order
2. for each model I want to re-layout:
2.1. run macro created in 1.
2.2. run report to set new desired layout (where SetPosition is called for occs)
And it works.
This idea came to me when I noticed that saving manually the model *before* running the report actually allowed the positions to be "visually" changed.
What it seems is that Designer keeps some kind of visual layout cache until some user interactions occur...Or it's just some flag that is set and I'm not aware of it.
Thanks for helping!
Hi!
In this case, it's surely the LAYOUTONOPEN - flag, which is set when the models are created by a report.
Please try removing this flag from the model flags in the report which sets the positions using Model.SetFlags():
Please. Help me!
Hi, that solved the problem, no need for macros!
Many Thanks!
Hi, can I see your solution with a macro? How do you run a macro from a report?
Thank you in advance.