<?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: in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/find-for-nearest-object/m-p/313887#M58789</link>
    <description>&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Don't know if this helps but...&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;I did somthing similar but decided that I wanted to &lt;BR /&gt;
loop through the smallest sset poosible so starting from the point that I &lt;BR /&gt;
picked, I created a selection set with a crossing window that began one unit &lt;BR /&gt;
below and to the left and ended one unit to the right and above. If something &lt;BR /&gt;
was found, check the distance on the entites (unless only one was found). If &lt;BR /&gt;
nothing was found, add one more unit to each of the points. Keep repeating until &lt;BR /&gt;
results is found or offset reaches a preset number (a max distance value). Why &lt;BR /&gt;
am I blabbering?? Here is the code, see if it helps....&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Public Function FindNearestEntity(ByVal Point1 As &lt;BR /&gt;
Variant, ByVal MaxDistance As Double, Optional LayerPattern As String = "*") As &lt;BR /&gt;
AcadEntity&lt;BR /&gt;&amp;nbsp; Dim sst_items As AcadSelectionSet&lt;BR /&gt;&amp;nbsp; Dim ent_retrn &lt;BR /&gt;
As AcadEntity&lt;BR /&gt;&amp;nbsp; Dim dbl_offst As Double&lt;BR /&gt;&amp;nbsp; Dim pnt_lleft(2) As &lt;BR /&gt;
Double&lt;BR /&gt;&amp;nbsp; Dim pnt_urght(2) As Double&lt;BR /&gt;&amp;nbsp; Dim dxf_codes(7) As &lt;BR /&gt;
Integer&lt;BR /&gt;&amp;nbsp; Dim dxf_value(7) As Variant&lt;BR /&gt;&amp;nbsp; Dim dbl_prevs As &lt;BR /&gt;
Double&lt;BR /&gt;&amp;nbsp; Dim dbl_distn As Double&lt;BR /&gt;&amp;nbsp; Dim pnt_nears As &lt;BR /&gt;
Variant&lt;BR /&gt;&amp;nbsp; Dim ent_check As AcadEntity&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; dxf_codes(0) &lt;BR /&gt;
= 8&lt;BR /&gt;&amp;nbsp; dxf_value(0) = LayerPattern&lt;BR /&gt;&amp;nbsp; dxf_codes(1) = -4&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
dxf_value(1) = "&amp;lt;OR"&lt;BR /&gt;&amp;nbsp; dxf_codes(2) = 0&lt;BR /&gt;&amp;nbsp; dxf_value(2) = &lt;BR /&gt;
"LINE"&lt;BR /&gt;&amp;nbsp; dxf_codes(3) = 0&lt;BR /&gt;&amp;nbsp; dxf_value(3) = "CIRCLE"&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
dxf_codes(4) = 0&lt;BR /&gt;&amp;nbsp; dxf_value(4) = "ARC"&lt;BR /&gt;&amp;nbsp; dxf_codes(5) = &lt;BR /&gt;
0&lt;BR /&gt;&amp;nbsp; dxf_value(5) = "POLYLINE"&lt;BR /&gt;&amp;nbsp; dxf_codes(6) = 0&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
dxf_value(6) = "LWPOLYLINE"&lt;BR /&gt;&amp;nbsp; dxf_codes(7) = -4&lt;BR /&gt;&amp;nbsp; dxf_value(7) = &lt;BR /&gt;
"OR&amp;gt;"&lt;BR /&gt;&amp;nbsp; dbl_offst = 2&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp;On Local Error Resume Next&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
ThisDrawing.SelectionSets("FindNearest").Delete&lt;BR /&gt;&amp;nbsp; Set sst_items = &lt;BR /&gt;
ThisDrawing.SelectionSets.Add("FindNearest")&lt;BR /&gt;&amp;nbsp;On Local Error GoTo &lt;BR /&gt;
0&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; Do While dbl_offst &amp;lt; MaxDistance&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
pnt_lleft(0) = Point1(0) - dbl_offst&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt_lleft(1) = &lt;BR /&gt;
Point1(1) - dbl_offst&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt_urght(0) = Point1(0) + &lt;BR /&gt;
dbl_offst&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt_urght(1) = Point1(1) + &lt;BR /&gt;
dbl_offst&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sst_items.Select &lt;BR /&gt;
acSelectionSetCrossing, pnt_lleft, pnt_urght, dxf_codes, &lt;BR /&gt;
dxf_value&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If sst_items.Count = 1 &lt;BR /&gt;
Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set ent_retrn = &lt;BR /&gt;
sst_items.Item(0)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit &lt;BR /&gt;
Do&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ElseIf sst_items.Count &amp;gt; 0 &lt;BR /&gt;
Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'process each entity to see which one is &lt;BR /&gt;
actually closer....&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each ent_check In &lt;BR /&gt;
sst_items&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt_nears = &lt;BR /&gt;
tjnLSP.ClosestPointTo(ent_check, Point1, &lt;BR /&gt;
False)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Not &lt;BR /&gt;
tjnARR.ArrayIsEmpty(pnt_nears) &lt;BR /&gt;
Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbl_distn = &lt;BR /&gt;
tjnCAL.Distance(Point1, &lt;BR /&gt;
pnt_nears)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If &lt;BR /&gt;
dbl_prevs = 0 &lt;BR /&gt;
Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set &lt;BR /&gt;
ent_retrn = &lt;BR /&gt;
ent_check&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
dbl_prevs = dbl_distn&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
ElseIf dbl_distn &amp;lt; dbl_prevs &lt;BR /&gt;
Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set &lt;BR /&gt;
ent_retrn = &lt;BR /&gt;
ent_check&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
dbl_prevs = dbl_distn&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
End If&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End &lt;BR /&gt;
If&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt_nears = &lt;BR /&gt;
Empty&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
Exit Do&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbl_offst = dbl_offst &lt;BR /&gt;
+ 2&lt;BR /&gt;&amp;nbsp; Loop&lt;BR /&gt;&amp;nbsp; Set FindNearestEntity = ent_retrn&lt;BR /&gt;End &lt;BR /&gt;
Function&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;BR /&gt;
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;"dan01" &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:dshrader@lnw-inc.com"&amp;gt;dshrader@lnw-inc.com&lt;/A&gt;&amp;gt; wrote in &lt;BR /&gt;
  message &lt;A&gt;&lt;BR /&gt;
  href="news:f1a35be.1@WebX.maYIadrTaRb"&amp;gt;news:f1a35be.1@WebX.maYIadrTaRb&lt;/A&gt;...&lt;/DIV&gt;Thanks &lt;BR /&gt;
  for reply, but I know how to find the distance between a point and a line. I &lt;BR /&gt;
  was just looking for a simpler way to find the closest line to a &lt;BR /&gt;
point.&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Thu, 04 Dec 2003 12:49:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2003-12-04T12:49:08Z</dc:date>
    <item>
      <title>Find for nearest object?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/find-for-nearest-object/m-p/313884#M58786</link>
      <description>Hi,&lt;BR /&gt;
does anyone know an easy way to find the nearest line to a point.  The way I have been doing this is creating a selection set of lines and looping thru the lines, checking the distances and if the distance is shorter than the last hold that one.  I was kinda looking from a less eloborate way to find this.  Thanks</description>
      <pubDate>Thu, 04 Dec 2003 11:11:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/find-for-nearest-object/m-p/313884#M58786</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-12-04T11:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Find for nearest object?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/find-for-nearest-object/m-p/313885#M58787</link>
      <description>http://www.ping.be/math/recht.htm</description>
      <pubDate>Thu, 04 Dec 2003 11:36:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/find-for-nearest-object/m-p/313885#M58787</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-12-04T11:36:15Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/find-for-nearest-object/m-p/313886#M58788</link>
      <description>Thanks for reply, but I know how to find the distance between a point and a line.  I was just looking for a simpler way to find the closest line to a point.</description>
      <pubDate>Thu, 04 Dec 2003 11:46:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/find-for-nearest-object/m-p/313886#M58788</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-12-04T11:46:16Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/find-for-nearest-object/m-p/313887#M58789</link>
      <description>&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Don't know if this helps but...&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;I did somthing similar but decided that I wanted to &lt;BR /&gt;
loop through the smallest sset poosible so starting from the point that I &lt;BR /&gt;
picked, I created a selection set with a crossing window that began one unit &lt;BR /&gt;
below and to the left and ended one unit to the right and above. If something &lt;BR /&gt;
was found, check the distance on the entites (unless only one was found). If &lt;BR /&gt;
nothing was found, add one more unit to each of the points. Keep repeating until &lt;BR /&gt;
results is found or offset reaches a preset number (a max distance value). Why &lt;BR /&gt;
am I blabbering?? Here is the code, see if it helps....&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Public Function FindNearestEntity(ByVal Point1 As &lt;BR /&gt;
Variant, ByVal MaxDistance As Double, Optional LayerPattern As String = "*") As &lt;BR /&gt;
AcadEntity&lt;BR /&gt;&amp;nbsp; Dim sst_items As AcadSelectionSet&lt;BR /&gt;&amp;nbsp; Dim ent_retrn &lt;BR /&gt;
As AcadEntity&lt;BR /&gt;&amp;nbsp; Dim dbl_offst As Double&lt;BR /&gt;&amp;nbsp; Dim pnt_lleft(2) As &lt;BR /&gt;
Double&lt;BR /&gt;&amp;nbsp; Dim pnt_urght(2) As Double&lt;BR /&gt;&amp;nbsp; Dim dxf_codes(7) As &lt;BR /&gt;
Integer&lt;BR /&gt;&amp;nbsp; Dim dxf_value(7) As Variant&lt;BR /&gt;&amp;nbsp; Dim dbl_prevs As &lt;BR /&gt;
Double&lt;BR /&gt;&amp;nbsp; Dim dbl_distn As Double&lt;BR /&gt;&amp;nbsp; Dim pnt_nears As &lt;BR /&gt;
Variant&lt;BR /&gt;&amp;nbsp; Dim ent_check As AcadEntity&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; dxf_codes(0) &lt;BR /&gt;
= 8&lt;BR /&gt;&amp;nbsp; dxf_value(0) = LayerPattern&lt;BR /&gt;&amp;nbsp; dxf_codes(1) = -4&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
dxf_value(1) = "&amp;lt;OR"&lt;BR /&gt;&amp;nbsp; dxf_codes(2) = 0&lt;BR /&gt;&amp;nbsp; dxf_value(2) = &lt;BR /&gt;
"LINE"&lt;BR /&gt;&amp;nbsp; dxf_codes(3) = 0&lt;BR /&gt;&amp;nbsp; dxf_value(3) = "CIRCLE"&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
dxf_codes(4) = 0&lt;BR /&gt;&amp;nbsp; dxf_value(4) = "ARC"&lt;BR /&gt;&amp;nbsp; dxf_codes(5) = &lt;BR /&gt;
0&lt;BR /&gt;&amp;nbsp; dxf_value(5) = "POLYLINE"&lt;BR /&gt;&amp;nbsp; dxf_codes(6) = 0&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
dxf_value(6) = "LWPOLYLINE"&lt;BR /&gt;&amp;nbsp; dxf_codes(7) = -4&lt;BR /&gt;&amp;nbsp; dxf_value(7) = &lt;BR /&gt;
"OR&amp;gt;"&lt;BR /&gt;&amp;nbsp; dbl_offst = 2&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp;On Local Error Resume Next&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
ThisDrawing.SelectionSets("FindNearest").Delete&lt;BR /&gt;&amp;nbsp; Set sst_items = &lt;BR /&gt;
ThisDrawing.SelectionSets.Add("FindNearest")&lt;BR /&gt;&amp;nbsp;On Local Error GoTo &lt;BR /&gt;
0&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; Do While dbl_offst &amp;lt; MaxDistance&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
pnt_lleft(0) = Point1(0) - dbl_offst&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt_lleft(1) = &lt;BR /&gt;
Point1(1) - dbl_offst&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt_urght(0) = Point1(0) + &lt;BR /&gt;
dbl_offst&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt_urght(1) = Point1(1) + &lt;BR /&gt;
dbl_offst&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sst_items.Select &lt;BR /&gt;
acSelectionSetCrossing, pnt_lleft, pnt_urght, dxf_codes, &lt;BR /&gt;
dxf_value&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If sst_items.Count = 1 &lt;BR /&gt;
Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set ent_retrn = &lt;BR /&gt;
sst_items.Item(0)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit &lt;BR /&gt;
Do&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ElseIf sst_items.Count &amp;gt; 0 &lt;BR /&gt;
Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'process each entity to see which one is &lt;BR /&gt;
actually closer....&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each ent_check In &lt;BR /&gt;
sst_items&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt_nears = &lt;BR /&gt;
tjnLSP.ClosestPointTo(ent_check, Point1, &lt;BR /&gt;
False)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Not &lt;BR /&gt;
tjnARR.ArrayIsEmpty(pnt_nears) &lt;BR /&gt;
Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbl_distn = &lt;BR /&gt;
tjnCAL.Distance(Point1, &lt;BR /&gt;
pnt_nears)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If &lt;BR /&gt;
dbl_prevs = 0 &lt;BR /&gt;
Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set &lt;BR /&gt;
ent_retrn = &lt;BR /&gt;
ent_check&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
dbl_prevs = dbl_distn&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
ElseIf dbl_distn &amp;lt; dbl_prevs &lt;BR /&gt;
Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set &lt;BR /&gt;
ent_retrn = &lt;BR /&gt;
ent_check&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
dbl_prevs = dbl_distn&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
End If&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End &lt;BR /&gt;
If&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt_nears = &lt;BR /&gt;
Empty&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
Exit Do&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbl_offst = dbl_offst &lt;BR /&gt;
+ 2&lt;BR /&gt;&amp;nbsp; Loop&lt;BR /&gt;&amp;nbsp; Set FindNearestEntity = ent_retrn&lt;BR /&gt;End &lt;BR /&gt;
Function&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;BR /&gt;
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;"dan01" &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:dshrader@lnw-inc.com"&amp;gt;dshrader@lnw-inc.com&lt;/A&gt;&amp;gt; wrote in &lt;BR /&gt;
  message &lt;A&gt;&lt;BR /&gt;
  href="news:f1a35be.1@WebX.maYIadrTaRb"&amp;gt;news:f1a35be.1@WebX.maYIadrTaRb&lt;/A&gt;...&lt;/DIV&gt;Thanks &lt;BR /&gt;
  for reply, but I know how to find the distance between a point and a line. I &lt;BR /&gt;
  was just looking for a simpler way to find the closest line to a &lt;BR /&gt;
point.&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Thu, 04 Dec 2003 12:49:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/find-for-nearest-object/m-p/313887#M58789</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-12-04T12:49:08Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/find-for-nearest-object/m-p/313888#M58790</link>
      <description>Hi Dan,&lt;BR /&gt;
&lt;BR /&gt;
Your first idea is as good as you can get.  You can't expect the computer to&lt;BR /&gt;
provide an answer without investigating every line in the set.&lt;BR /&gt;
&lt;BR /&gt;
However, you may be able to limit the lines to investigate by creating your&lt;BR /&gt;
selection set of lines using a crossing window.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Laurie Comerford&lt;BR /&gt;
CADApps&lt;BR /&gt;
www.cadapps.com.au&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"dan01" &lt;DSHRADER&gt; wrote in message&lt;BR /&gt;
news:f1a35be.1@WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; Thanks for reply, but I know how to find the distance between a point and&lt;BR /&gt;
a line. I was just looking for a simpler way to find the closest line to a&lt;BR /&gt;
point.&lt;/DSHRADER&gt;</description>
      <pubDate>Thu, 04 Dec 2003 12:59:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/find-for-nearest-object/m-p/313888#M58790</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-12-04T12:59:06Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/find-for-nearest-object/m-p/313889#M58791</link>
      <description>Thanks you all for the help.</description>
      <pubDate>Thu, 04 Dec 2003 13:38:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/find-for-nearest-object/m-p/313889#M58791</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-12-04T13:38:14Z</dc:date>
    </item>
  </channel>
</rss>

