Exemple #1
0
        public static void SaveSelection()
        {
            var ids = Interaction.GetPickSet();

            if (ids.Length == 0)
            {
                Interaction.WriteLine("No entity selected.");
                return;
            }
            string name = Interaction.GetString("\nSelection name");

            if (name == null)
            {
                return;
            }
            if (CustomDictionary.GetValue("Selections", name) != string.Empty)
            {
                Interaction.WriteLine("Selection with the same name already exists.");
                return;
            }
            var    handles   = ids.QSelect(entity => entity.Handle.Value.ToString()).ToArray();
            string dictValue = string.Join("|", handles);

            CustomDictionary.SetValue("Selections", name, dictValue);
        }