<?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: Questions about ElementIntersectsSolidFIlter in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/questions-about-elementintersectssolidfilter/m-p/7537860#M54866</link>
    <description>&lt;P&gt;Dear&amp;nbsp;&lt;SPAN&gt;FAIR59,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you very much for answering my question and giving me the valuable suggestions. I really appreciate that!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Nov 2017 01:44:07 GMT</pubDate>
    <dc:creator>GZ1178</dc:creator>
    <dc:date>2017-11-13T01:44:07Z</dc:date>
    <item>
      <title>Questions about ElementIntersectsSolidFIlter</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/questions-about-elementintersectssolidfilter/m-p/7536199#M54864</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I once used ElementIntersectsSolid filter to find elements intersecting with a given solid, &amp;nbsp;but the instances belonging to Site Family cannot&amp;nbsp;be obtained by the filter. Could anyone please do me a favor to tell me 1、Why such situation occurs and 2、How to&amp;nbsp;use the filter to get instances of&amp;nbsp;Site?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.s The code is shown below:&lt;/P&gt;&lt;PRE&gt;[Transaction(TransactionMode.Manual)]
    [Regeneration(RegenerationOption.Manual)]
    public class SolidIntersectElementTest : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            //select a floor
            Document doc = commandData.Application.ActiveUIDocument.Document;
            Element floor = new FilteredElementCollector(doc).WhereElementIsNotElementType().OfCategory(BuiltInCategory.OST_Floors).FirstElement();
            //get the upper face
            Options opt = new Options();
            opt.ComputeReferences = true;
            opt.View = doc.ActiveView;
            var geos = floor.get_Geometry(opt);
            PlanarFace refFace = null;
            foreach(GeometryObject geoElem in geos)
            {
                if(geoElem is Solid)
                {
                    Solid sld = geoElem as Solid;
                    if(sld.Faces.Size&amp;gt;0)
                    {
                        foreach(Face fa in sld.Faces)
                        {
                            if(fa is PlanarFace)
                            {
                                PlanarFace pfa = fa as PlanarFace;
                                if(pfa.FaceNormal.Z&amp;gt;0)
                                {
                                    refFace = pfa;
                                    break;
                                }
                            }
                        }
                    }
                }
            }
            if(refFace!=null)
            {
                var faceCvrLoops = refFace.GetEdgesAsCurveLoops();
                //generate a solid
                Solid testSolid = GeometryCreationUtilities.CreateExtrusionGeometry(faceCvrLoops, new XYZ(0, 0, 1), 2000 / 304.8);
                //apply solid intersection result
                FilteredElementCollector sldIntersectColl = new FilteredElementCollector(doc).WhereElementIsNotElementType();
                ElementIntersectsSolidFilter filter = new ElementIntersectsSolidFilter(testSolid);
                List&amp;lt;Element&amp;gt; lstElemFound = sldIntersectColl.WherePasses(filter).ToElements().ToList();
                //show the element found
                string strElemNamesAndCateogries = "Element found:\n";
                foreach(Element elem in lstElemFound)
                {
                    if(!( elem is FamilyInstance))
                    {
                        strElemNamesAndCateogries += elem.Name + "(" + elem.Category.Name + ")\n";
                    }
                    else
                    {
                        FamilyInstance fi = elem as FamilyInstance;
                        strElemNamesAndCateogries += elem.Name + "(" + fi.Symbol.Family.Name + ")\n";
                    }
                    
                }
                System.Windows.Forms.MessageBox.Show(strElemNamesAndCateogries);
                return Result.Succeeded;
            }
            else
            {
                return Result.Failed;
            }
            
            //throw new NotImplementedException();
        }
    }&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 Nov 2017 12:40:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/questions-about-elementintersectssolidfilter/m-p/7536199#M54864</guid>
      <dc:creator>GZ1178</dc:creator>
      <dc:date>2017-11-11T12:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: Questions about ElementIntersectsSolidFIlter</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/questions-about-elementintersectssolidfilter/m-p/7537251#M54865</link>
      <description>&lt;P&gt;the remark for the usage of an ElementIntersectsElementFilter states:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;The target object is another element. The intersection is determined with the same logic used by Revit to determine if an interference exists during generation of an Interference Report. (This means that some combinations of elements will never be detected as intersecting by this filter, such as concrete members which are automatically joined at their intersections). Also, elements which have no solid geometry, such as Rebar, will never be detected as intersecting by this filter&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;this are the categories for a interference report:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="interference_categories.PNG" style="width: 163px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/425075i46EE216AE61C1FEE/image-size/small?v=v2&amp;amp;px=200" role="button" title="interference_categories.PNG" alt="interference_categories.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect&amp;nbsp;that the same categories are "in play" for&amp;nbsp;an&amp;nbsp;the ElementIntersectsSolidFilter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To find Site-families I see 2 options:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. use a&amp;nbsp;BoundingBoxIntersectsFilter,&lt;/P&gt;
&lt;P&gt;2. temporary clone the Site-families using a DirectShape defined with a category that an ElementIntersectsSolidFilter can find. (e.g. Generic Model)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;workflow option 2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;start TransactionGroup&lt;/LI&gt;
&lt;LI&gt;start Transaction&lt;/LI&gt;
&lt;LI&gt;foreach Site-family
&lt;UL&gt;
&lt;LI&gt;clone the solids from the geometry&lt;/LI&gt;
&lt;LI&gt;create DirectShape&lt;/LI&gt;
&lt;LI&gt;DirectShape.AppendShape( clonedsolids)&lt;/LI&gt;
&lt;LI&gt;store combination &amp;lt;directshape.Id, familyinstance.id&amp;gt; in a Dictionary&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;commit Transaction.&lt;/LI&gt;
&lt;LI&gt;find elements passing the ElementIntersectsSolidFilter&lt;/LI&gt;
&lt;LI&gt;rollback TransActionGroup&lt;/LI&gt;
&lt;LI&gt;foreach elem in &amp;nbsp;lstElemFound
&lt;UL&gt;
&lt;LI&gt;if (elem is DirectShape)&amp;nbsp;retrieve &amp;nbsp;id&amp;nbsp;of original familyinstance from stored Dictionary&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Nov 2017 13:55:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/questions-about-elementintersectssolidfilter/m-p/7537251#M54865</guid>
      <dc:creator>FAIR59</dc:creator>
      <dc:date>2017-11-12T13:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: Questions about ElementIntersectsSolidFIlter</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/questions-about-elementintersectssolidfilter/m-p/7537860#M54866</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;SPAN&gt;FAIR59,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you very much for answering my question and giving me the valuable suggestions. I really appreciate that!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 01:44:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/questions-about-elementintersectssolidfilter/m-p/7537860#M54866</guid>
      <dc:creator>GZ1178</dc:creator>
      <dc:date>2017-11-13T01:44:07Z</dc:date>
    </item>
  </channel>
</rss>

