<?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: Check to see if a point is inside bounding box in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/check-to-see-if-a-point-is-inside-bounding-box/m-p/9169056#M79000</link>
    <description>&lt;P&gt;I would have expected the original to be correct. I don't remember how it was tested. Normally, in .NET, Compare(a,b) returns a negative number if a is smaller than b, zero if equal, and positive otherwise. E.g.., for strings:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/dotnet/api/system.string.compare?view=netframework-4.8" target="_blank"&gt;https://docs.microsoft.com/en-us/dotnet/api/system.string.compare?view=netframework-4.8&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All overloads of the Compare method return a 32-bit signed integer indicating the lexical relationship between the two comparands:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Value -- Condition&lt;/LI&gt;
&lt;LI&gt;Less than zero The first substring precedes the second substring in the sort order.&lt;/LI&gt;
&lt;LI&gt;Zero The substrings occur in the same position in the sort order, or length is zero.&lt;/LI&gt;
&lt;LI&gt;Greater than zero The first substring follows the second substring in the sort order.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Step through in the debugger and let us know, please. We absolutely must ensure that it works correctly, being sample code that people refer to...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Nov 2019 07:10:22 GMT</pubDate>
    <dc:creator>jeremytammik</dc:creator>
    <dc:date>2019-11-27T07:10:22Z</dc:date>
    <item>
      <title>Check to see if a point is inside bounding box</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/check-to-see-if-a-point-is-inside-bounding-box/m-p/4354446#M78993</link>
      <description>&lt;P&gt;I'm working through a 4 year old example that uses code that's no longer valid.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    // test if the bounding box contains our point:

    if( Geometry.BoundingBoxXYZContains(
      newRoom.get_BoundingBox( null ), 
      xyz ) )
    {      
      break;  
    }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 14px;"&gt;I cant find any reference to 'Geometry.BoundryBoxXYZContains'. How would this be acomplished? Thanks.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2013 16:36:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/check-to-see-if-a-point-is-inside-bounding-box/m-p/4354446#M78993</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-05T16:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: Check to see if a point is inside bounding box</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/check-to-see-if-a-point-is-inside-bounding-box/m-p/4355014#M78994</link>
      <description>&lt;P&gt;Not sure if there is a pre-rolled API method any more but you could just do it manually by comparing the test point to the points gathered by Min &amp;amp;&amp;nbsp;&lt;SPAN&gt;Max properties of the &lt;SPAN&gt;BoundingBoxXYZ object gathered from your room&lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2013 07:04:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/check-to-see-if-a-point-is-inside-bounding-box/m-p/4355014#M78994</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-06T07:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Check to see if a point is inside bounding box</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/check-to-see-if-a-point-is-inside-bounding-box/m-p/4359365#M78995</link>
      <description>&lt;P&gt;Yes, that worked. I'm still having trouble getting the whole addin to work though. I'm creating unplaced rooms in from an excel file and populating a listbox with the unplaced rooms. I'm trying to place thoes rooms. I'm getting transaction errors, room height errors, you name it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;foreach (PlanCircuit circuit in planTopology.Circuits)
                {
                    if (!circuit.IsRoomLocated)
                    {                      
                        Room selectedRoom = (Room)box.SelectedItem;

                        Room newRoom = doc.Create.NewRoom(selectedRoom, circuit);
                        BoundingBoxXYZ BB = newRoom.get_BoundingBox(null);

                        if (BB.Min.X &amp;lt; selectedPoint.X &amp;amp;&amp;amp; BB.Min.Y &amp;lt; selectedPoint.Y)
                        {
                            if (BB.Max.X &amp;gt; selectedPoint.X &amp;amp;&amp;amp; BB.Max.Y &amp;gt; selectedPoint.Y)
                            {
                                trans.Commit();                                
                                break;
                            }
                        }
                        else
                        {
                            doc.Delete(newRoom);
                            newRoom = null;
                        }
                    }
                }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2013 14:16:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/check-to-see-if-a-point-is-inside-bounding-box/m-p/4359365#M78995</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-08T14:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: Check to see if a point is inside bounding box</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/check-to-see-if-a-point-is-inside-bounding-box/m-p/4359738#M78996</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Dear Bryan,&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Geometry.BoundingBoxXYZContains&amp;nbsp;is not a standard Revit API method, as far as I know, and never was.&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Probably it was implemented by someone as a custom extension method along the lines suggested by scottwilson3525.&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Here is a sample implementation of a suitable comparison operator for the XYZ point class:&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; const double _eps = 1.0e-9;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; public static bool IsZero(&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; double a,&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; double tolerance )&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; {&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return tolerance &amp;gt; Math.Abs( a );&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; }&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; public static bool IsZero( double a )&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; {&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return IsZero( a, _eps );&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; }&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; public static bool IsEqual( double a, double b )&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; {&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return IsZero( b - a );&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; }&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; public static int Compare( double a, double b )&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; {&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return IsEqual( a, b ) ? 0 : ( a &amp;lt; b ? -1 : 1 );&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; }&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; public static int Compare( XYZ p, XYZ q )&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; {&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; int d = Compare( p.X, q.X );&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( 0 == d )&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; d = Compare( p.Y, q.Y );&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( 0 == d )&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; d = Compare( p.Z, q.Z );&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return d;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; }&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; public static bool IsEqual( XYZ p, XYZ q )&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; {&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0 == Compare( p, q );&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; }&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;Now you can implement BoundingBoxXyzContains like this:&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; /// &amp;lt;summary&amp;gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; /// Return true if the given bounding box bb&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; /// contains the given point p in its interior.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; /// &amp;lt;/summary&amp;gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; public bool BoundingBoxXyzContains(&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BoundingBoxXYZ bb,&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; XYZ p )&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; {&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0 &amp;lt; Compare( bb.Min, p )&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;&amp;amp; 0 &amp;lt; Compare( p, bb.Max );&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; }&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;I'm unable to say anything about all the room placement errors you are getting, though. Sorry.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;That's out of the scope of this thread, anyway&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;I hope this helps anyway.&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Best regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Jeremy&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2013 16:53:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/check-to-see-if-a-point-is-inside-bounding-box/m-p/4359738#M78996</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2013-08-08T16:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: Check to see if a point is inside bounding box</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/check-to-see-if-a-point-is-inside-bounding-box/m-p/4360131#M78997</link>
      <description>&lt;P&gt;I'm glad you got some of it sorted out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In regard to the transaction errors, I see that you are commiting your transaction within the foreach loop when a match is found and then breaking out of the loop. What are you doing after this? If you are modifying the database again after this code then you will get transaction errors. To fix this, just move the comit further down in your code (at end of method maybe?). Also check that your are not attempting to create a new transaction within an already active one.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2013 23:00:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/check-to-see-if-a-point-is-inside-bounding-box/m-p/4360131#M78997</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-08T23:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Check to see if a point is inside bounding box</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/check-to-see-if-a-point-is-inside-bounding-box/m-p/9168490#M78998</link>
      <description>&lt;P&gt;Hi Jeremry, correct me if I'm wrong, but should the Compare parameters be the other way round implementation and should actually be like this:&lt;/P&gt;&lt;PRE&gt;        public bool BoundingBoxXyzContains(BoundingBoxXYZ bb,XYZ p)
        {
            return 0 &amp;lt; Compare(p, bb.Min)
              &amp;amp;&amp;amp; 0 &amp;lt; Compare(bb.Max, p);
        }&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Nov 2019 21:53:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/check-to-see-if-a-point-is-inside-bounding-box/m-p/9168490#M78998</guid>
      <dc:creator>joshua.lumley</dc:creator>
      <dc:date>2019-11-26T21:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Check to see if a point is inside bounding box</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/check-to-see-if-a-point-is-inside-bounding-box/m-p/9168528#M78999</link>
      <description>&lt;P&gt;same as check if is it polygon as example here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://csharphelper.com/blog/2014/07/determine-whether-a-point-is-inside-a-polygon-in-c/" target="_blank"&gt;http://csharphelper.com/blog/2014/07/determine-whether-a-point-is-inside-a-polygon-in-c/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 22:26:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/check-to-see-if-a-point-is-inside-bounding-box/m-p/9168528#M78999</guid>
      <dc:creator>sonicer</dc:creator>
      <dc:date>2019-11-26T22:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Check to see if a point is inside bounding box</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/check-to-see-if-a-point-is-inside-bounding-box/m-p/9169056#M79000</link>
      <description>&lt;P&gt;I would have expected the original to be correct. I don't remember how it was tested. Normally, in .NET, Compare(a,b) returns a negative number if a is smaller than b, zero if equal, and positive otherwise. E.g.., for strings:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/dotnet/api/system.string.compare?view=netframework-4.8" target="_blank"&gt;https://docs.microsoft.com/en-us/dotnet/api/system.string.compare?view=netframework-4.8&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All overloads of the Compare method return a 32-bit signed integer indicating the lexical relationship between the two comparands:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Value -- Condition&lt;/LI&gt;
&lt;LI&gt;Less than zero The first substring precedes the second substring in the sort order.&lt;/LI&gt;
&lt;LI&gt;Zero The substrings occur in the same position in the sort order, or length is zero.&lt;/LI&gt;
&lt;LI&gt;Greater than zero The first substring follows the second substring in the sort order.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Step through in the debugger and let us know, please. We absolutely must ensure that it works correctly, being sample code that people refer to...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 07:10:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/check-to-see-if-a-point-is-inside-bounding-box/m-p/9169056#M79000</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2019-11-27T07:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Check to see if a point is inside bounding box</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/check-to-see-if-a-point-is-inside-bounding-box/m-p/9170499#M79001</link>
      <description>&lt;P&gt;The inverted code works on my current project but maybe everything is mirrored or otherwise quirky that makes it different. I will be sure after the inverted code is tested on several different projects.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 19:30:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/check-to-see-if-a-point-is-inside-bounding-box/m-p/9170499#M79001</guid>
      <dc:creator>joshua.lumley</dc:creator>
      <dc:date>2019-11-27T19:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: Check to see if a point is inside bounding box</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/check-to-see-if-a-point-is-inside-bounding-box/m-p/9170561#M79002</link>
      <description>&lt;P&gt;The Compare method that you are calling there might be set up wrong, returning an inverted result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That is why I suggest stepping through all the nested calls in a debugger and ensuring that none of the nested steps is defined the wrong way round.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 20:06:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/check-to-see-if-a-point-is-inside-bounding-box/m-p/9170561#M79002</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2019-11-27T20:06:27Z</dc:date>
    </item>
  </channel>
</rss>

