Hi everyone,
Is there a simple way to get all types of objects (objects that I already store in "objdefs") and show them in checkboxes ? (I don't want to use a listbox because I need to let the user have a multiple choice).
how I store my objects :
var loc = Context.getSelectedLanguage();
var group = ArisData.getSelectedGroups()[0];
//stocker tous les modèles
var grpMdls = ArisData.getSelectedGroups()[0].ModelList(true);
//récupérer tous les objets des modèles
var objdefs = new Array();
for(var i = 0; i < grpMdls.length; i++){
objdefs = objdefs.concat(grpMdls[i].ObjDefList());
}
Thank you in advance !
Kay Fischbach on
Hi
may I ask what's wrong with giving the user a ListBox for multiple choice?
While it does not support multiple choice by default, if your last parameter is 1 (supports multi-select) or 2 (sorted + supports multi-select) users will be able to select multiple items. Controls are similar to what you'd find in a file explorer - hold ctrl and click on entries to toggle their individual selection, or click on one item, hold shift and click on another item to select a range of items (first clicked item + last clicked item + everything in between).
***
How to get the Object defs actually into the list? Don't think there is a way other than creating a string array with the object def names. That's fairly easy - and would be even easier if the ArisScript engine would comply with the EMCA2015 standard (or newer) giving us access to arrow functions - but sadly it does not support that, so you'll have to do something like
The order of objects is retained throughout the mapping process, so when your dialog returns that the usere selected string element 2, 5 and 8 you can easily look up in your original array which objectdefs are at index position 2, 5 and 8.
Hope this helps.