<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Distinguishing AnnotationSymbol from other FamilyInstance members in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/distinguishing-annotationsymbol-from-other-familyinstance/m-p/6836939#M60669</link>
    <description>&lt;P&gt;Thanks Jeremy! As usual you provide good help. &amp;nbsp;It turns out that I can also just do this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;RDB.FilteredElementCollector coll2 = new RDB.FilteredElementCollector(doc, v.Id).OfClass(typeof(RDB.FamilyInstance));
var symbolInst = from e in coll2.ToElements() where e is RDB.AnnotationSymbol select e as RDB.AnnotationSymbol;
foreach(RDB.AnnotationSymbol s in symbolInst)
{
     // do stuff in here
}&lt;/PRE&gt;&lt;P&gt;which I adapted from one of your building coder posts dealing with filtering for non-native classes.&lt;/P&gt;</description>
    <pubDate>Fri, 27 Jan 2017 22:15:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-01-27T22:15:04Z</dc:date>
    <item>
      <title>Distinguishing AnnotationSymbol from other FamilyInstance members</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/distinguishing-annotationsymbol-from-other-familyinstance/m-p/6834829#M60667</link>
      <description>&lt;P&gt;I have an addin that will copy all of the schedules and legends from one sheet to another. &amp;nbsp;I am trying to expand the functionality to also copy the key plan (which is not part of the titleblock . . . it could be, but it is the corporate standard to not have it be for a variety of good and bad reasons). &amp;nbsp;My problem is that when I get a list of the FamilyInstances for the sheet like so:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;            RDB.FilteredElementCollector coll2 = new RDB.FilteredElementCollector(doc, v.Id);
            var symbolInst = coll2
                .OfClass(typeof(RDB.FamilyInstance))
                .ToElements();
//                .Where(x =&amp;gt; );
            foreach(RDB.FamilyInstance anno in symbolInst)
            {
                RDB.BoundingBoxXYZ xyzLoc = anno.get_BoundingBox(v);
            }&lt;/PRE&gt;&lt;P&gt;I end up with symbolInst having 2 members, one is the keyplan symbol, and the other is the titleblock. &amp;nbsp;I would like to filter out the titleblock somehow with the where clause, but I don't know how to exclude something . . . I was hoping to do a not OfCategory, but I'm blanking on how to do that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I stop the debugger and look I see that the keyplan symbol shows a value of "Autodesk.Revit.DB.AnnotationSymbol" but that is not allowed in the OFClass(typeof(XXX)) (it throws an error, thus I am using the base class FamilyInstance instead. &amp;nbsp;I could filter out with a test in the loop that follows, but I can't figure out how to test anno for being an AnnotationSymbol (or not an AnnotationSymbol).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas? Attached is a screen shot from the debugger Autos showing symbolInst expanded with 2 members, the value fields are shown as "Autodesk.Revit.DB.FamilyInstance" and "Autodesk.Revit.DB.AnnotationSymbol", but I don't know how to test for what "type" anno is within the loop.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 04:09:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/distinguishing-annotationsymbol-from-other-familyinstance/m-p/6834829#M60667</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-27T04:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: Distinguishing AnnotationSymbol from other FamilyInstance members</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/distinguishing-annotationsymbol-from-other-familyinstance/m-p/6835049#M60668</link>
      <description>&lt;P&gt;&amp;gt;&amp;nbsp;&lt;SPAN&gt; I was hoping to do a not OfCategory, but I'm blanking on how to do that.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can do a NOT OfCategory.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4 class="truncate"&gt;LogicalAndFilter Class&lt;/H4&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.revitapidocs.com/2017/3e334aaf-2b39-58bd-d2cc-94e9c89bac57.htm" target="_blank"&gt;http://www.revitapidocs.com/2017/3e334aaf-2b39-58bd-d2cc-94e9c89bac57.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4 class="truncate"&gt;ElementCategoryFilter Constructor (ElementId, Boolean), where the Boolean argument can specify 'inverted':&lt;/H4&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.revitapidocs.com/2017/3590e7e3-3e05-2d1a-f2af-8033eeb8996b.htm" target="_blank"&gt;http://www.revitapidocs.com/2017/3590e7e3-3e05-2d1a-f2af-8033eeb8996b.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 08:06:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/distinguishing-annotationsymbol-from-other-familyinstance/m-p/6835049#M60668</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2017-01-27T08:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: Distinguishing AnnotationSymbol from other FamilyInstance members</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/distinguishing-annotationsymbol-from-other-familyinstance/m-p/6836939#M60669</link>
      <description>&lt;P&gt;Thanks Jeremy! As usual you provide good help. &amp;nbsp;It turns out that I can also just do this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;RDB.FilteredElementCollector coll2 = new RDB.FilteredElementCollector(doc, v.Id).OfClass(typeof(RDB.FamilyInstance));
var symbolInst = from e in coll2.ToElements() where e is RDB.AnnotationSymbol select e as RDB.AnnotationSymbol;
foreach(RDB.AnnotationSymbol s in symbolInst)
{
     // do stuff in here
}&lt;/PRE&gt;&lt;P&gt;which I adapted from one of your building coder posts dealing with filtering for non-native classes.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 22:15:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/distinguishing-annotationsymbol-from-other-familyinstance/m-p/6836939#M60669</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-27T22:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: Distinguishing AnnotationSymbol from other FamilyInstance members</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/distinguishing-annotationsymbol-from-other-familyinstance/m-p/6840605#M60670</link>
      <description>&lt;P&gt;Ah yes, of course:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2010/08/filtering-for-a-nonnative-class.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2010/08/filtering-for-a-nonnative-class.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry I did not spot that and point it out explicitly myself right away.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 15:52:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/distinguishing-annotationsymbol-from-other-familyinstance/m-p/6840605#M60670</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2017-01-30T15:52:03Z</dc:date>
    </item>
  </channel>
</rss>

