예제 #1
0
        public IList <TextNote> SelectText(UIDocument UIdoc)
        {
            IList <Reference> selectedElements  = new List <Reference>();
            IList <TextNote>  selectedTextNotes = new List <TextNote>();

            ISelectionFilter selecFilter = new TextNoteSelectionFilter();

            selectedElements = UIdoc.Selection.PickObjects(ObjectType.Element, selecFilter);

            Debug("selected elements" + selectedElements.Count);



            foreach (Reference r in selectedElements)
            {
                Element  e = UIdoc.Document.GetElement(r.ElementId);
                TextNote t = e as TextNote;
                if (t != null)
                {
                    selectedTextNotes.Add(t);
                    Debug("selected elements" + selectedTextNotes.Count);
                }
            }

            return(selectedTextNotes);
        }
예제 #2
0
        public TextNote SelectText(UIDocument UIdoc)
        {
            ISelectionFilter selecFilter = new TextNoteSelectionFilter();

            Reference selectedElement = UIdoc.Selection.PickObject(ObjectType.Element, selecFilter);

            Element  e = UIdoc.Document.GetElement(selectedElement.ElementId);
            TextNote t = e as TextNote;

            if (t != null)
            {
                TextNote selectedTextNote = t;
                Debug("selected elements" + selectedTextNote.ToString());
                return(selectedTextNote);
            }

            return(null);
        }