Beispiel #1
0
        public static void SelectByLayer()
        {
            var options = DbHelper.GetAllLayerNames();
            var opt     = Gui.GetChoices("Specify layers", options);

            if (opt.Length < 1)
            {
                return;
            }
            var ids = QuickSelection.SelectAll().QWhere(x => opt.Contains(x.Layer)).ToArray();

            Interaction.SetPickSet(ids);
        }
Beispiel #2
0
        public static void SelectByLayer()
        {
            var availableLayerNames = DbHelper.GetAllLayerNames();
            var selectedLayerNames  = Gui.GetChoices("Specify layers", availableLayerNames);

            if (selectedLayerNames.Length < 1)
            {
                return;
            }

            var ids = QuickSelection
                      .SelectAll(FilterList.Create().Layer(selectedLayerNames))
                      .ToArray();

            Interaction.SetPickSet(ids);
        }
Beispiel #3
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());
        }