We have two views with separate visual overviews: an admin view and and a user view. The admin sets a value that is then used in the user visual overview to fetch data via a script. The views are used simultaneously but by different users and on different clients. I'm looking for what the best implementation would be for the admin to update the value and have it be updated "live" (and persistent) on the user visual overview (triggering an automation script which takes the value as a parameter).
A memory file is persistent and accessible by both view trough scripts but it can't be actively monitored in the way an element parameter would be. I haven't found a way to set a Property on a view programmatically. Creating an entire protocol and an element from that protocol just to set a value seems like a bit of an overkill.
What's the best approach?
Sorry for being a bit unclear. By view I mean visual overview. I’ve updated my post for clarification.
The value I’m setting is just a string value used in an automation script to fetch data from a specific row in a memory file.
Hi Robin,
If I understand correctly, a value needs to be used when triggering a script from a Visual Overview linked to a user view. This value can be updated by another script that is triggered from another admin view.
As these Visual Overview are linked to view, the best option will be to use a property defined on the user view to store (and update) the value that needs to be used. This can be done programmatically from a script, but required the use of the DIS Class Library as this is not available in the standard Engine object. More info on using the Class Library in Automation scripts can be found in this video (from the Automation course).
The code to update a property using the Class Libary would be something like this (with the necessary exception handling):
var dms = engine.GetDms();
var userView = dms.GetView("myUserView");
var valueProperty = (IWritableProperty)userView.Properties["myValuePropertyName"];
valueProperty.Value = "newValue";
userView.Update();
Just what I was looking for, just didn’t look trough the documentation thoroughly enough I guess.
Hi Robin,
I don’t fully understand what you are trying to achieve. With views in this case, you are talking about views in the surveyor and a user only has access to his own user view? Could you clarify what value you are exactly setting?