How to select only Independent tags and Textnotes from the current document with using PickObjects(ObjectType.Element, new MassSelectionFilter()); method .

How to select only Independent tags and Textnotes from the current document with using PickObjects(ObjectType.Element, new MassSelectionFilter()); method .

praveen.cMXB2H
Enthusiast Enthusiast
279 Views
1 Reply
Message 1 of 2

How to select only Independent tags and Textnotes from the current document with using PickObjects(ObjectType.Element, new MassSelectionFilter()); method .

praveen.cMXB2H
Enthusiast
Enthusiast

I can select only independent tags with using given below class but i want to select independent tags and TextNotes.

 

public class MassSelectionFilter : ISelectionFilter
{
public bool AllowElement(Element element)
{
return element is IndependentTag ;
}

public bool AllowReference(Reference refer, XYZ point)
{
return true;
}


}

 

with using above method i can able to select only independent tags or Textnotes but i want to select both.

0 Likes
280 Views
1 Reply
Reply (1)
Message 2 of 2

jeremy_tammik
Alumni
Alumni

You can implement the AllowElement method to return true when the desired element type is detected, e.g., a tag or text note.

  

I would strongly recommend renaming the selection filter so something other than MassSelectionFilter. The name MassSelectionFilter would seem to indicate that only mass elements can be selected.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes