Esempio n. 1
0
        public static void LoadSelection()
        {
            string name = Gui.GetChoice("Which selection to load?", CustomDictionary.GetEntryNames("Selections").ToArray());

            if (name == string.Empty)
            {
                return;
            }
            string dictValue = CustomDictionary.GetValue("Selections", name);
            var    handles   = dictValue.Split('|').Select(value => new Handle(Convert.ToInt64(value))).ToList();
            var    ids       = new List <ObjectId>();

            handles.ForEach(value =>
            {
                var id = ObjectId.Null;
                if (HostApplicationServices.WorkingDatabase.TryGetObjectId(value, out id))
                {
                    ids.Add(id);
                }
            });
            Interaction.SetPickSet(ids.ToArray());
        }