Hi guys,
I'm not familiar with scripting so please excuse my nooby question:
Is it possible to create a macro for merging a model from db1 to db2? The macro should be executed on a model which is selected by the user. How can this be selected? First idea is that the user should open the corresponding model and then choose "Evaluate" --> "start macro".....
So the macro would need the two input values "Source" and "Target". Can this values can be put in with a pop up where the user can fill in the needed values?
Other idea: the script should copy the model from db1 to the exact same position in db2. So the value "Target" is known. Furthermore the value "Source" is known because the user is logging into the source (database AND model).
I've found command
Context.getComponent("Merge") but this is obviously not all what I need, because when I create empty macro with this command and execute it on a model - the script editor opens and nothing happens.
How can I create the macro for merging my selected model in db1 into the same place in db2?
Thanks for ANY hint,
Andreas
Ilya Seletkov on
Hello.
1. You have to create GUI in your marcro/script. See "Dialogs" object in help for details.
In this GUI you can ask user for login data, method filter and language of 2nd db.
2. Then you may use ArisData.openDatabase() method to login into the 2nd db.
3. Next GUI's window have to provide user choice of model in 2nd db. Try to use method UserDialog.setBrowseArisItems() as subdialog for your main GUI. But for me it does not work properly in 2nd db. Only in the same db. So I use DialogTemplate.tree() method and create my own "Brows Items" dialog.
4. Then user select 2nd model, you can use merge component.
Hope, this helps.
BR, Ilya.