<?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: Draw polyline to nearest point in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/6338262#M132100</link>
    <description>&lt;P&gt;Here's a basic command to get you started... (apologies to all for posting C# code in the LISP forum)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Runtime;

namespace ConnectBlockToPolyline
{
  public class Commands
  {
    [CommandMethod("B2P")]
    public static void Block2Polyline()
    {
      var doc = Application.DocumentManager.MdiActiveDocument;
      if (doc == null)
        return;

      var db = doc.Database;
      var ed = doc.Editor;

      // Get the block to connect

      var peo = new PromptEntityOptions("\nSelect the block");
      peo.SetRejectMessage("\nMust be a block.");
      peo.AddAllowedClass(typeof(BlockReference), false);

      var per = ed.GetEntity(peo);
      if (per.Status != PromptStatus.OK)
        return;

      var brId = per.ObjectId;

      var peo2 = new PromptEntityOptions("\nSelect the curve");
      peo2.SetRejectMessage("\nMust be a curve.");
      peo2.AddAllowedClass(typeof(Curve), false);

      var per2 = ed.GetEntity(peo2);
      if (per2.Status != PromptStatus.OK)
        return;

      var cId = per2.ObjectId;

      using (var tr = doc.TransactionManager.StartTransaction())
      {
        var br = tr.GetObject(brId, OpenMode.ForRead) as BlockReference;
        if (br != null)
        {
          var btr =
            tr.GetObject(
              SymbolUtilityServices.GetBlockModelSpaceId(db), OpenMode.ForWrite
            ) as BlockTableRecord;

          if (btr != null)
          {
            var c = tr.GetObject(cId, OpenMode.ForRead) as Curve;
            if (c != null)
            {
              var pt = c.GetClosestPointTo(br.Position, false);

              var ln = new Line(br.Position, pt);
              btr.AppendEntity(ln);
              tr.AddNewlyCreatedDBObject(ln, true);
            }
          }
        }
        tr.Commit();
      }
    }
  }
}
&lt;/PRE&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 19 May 2016 16:19:04 GMT</pubDate>
    <dc:creator>kean_walmsley</dc:creator>
    <dc:date>2016-05-19T16:19:04Z</dc:date>
    <item>
      <title>Draw polyline to nearest point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/6333224#M132095</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I started this post within the generic AutoCAD forum but as suggested I have moved it here (old thread &lt;A href="https://forums.autodesk.com/t5/forums/replypage/board-id/706/message-id/124684" target="_self"&gt;here&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want to do is create a&amp;nbsp;command whereby the user would click a block, and it would search for a polyline within a given area and then draw a new 3D polyline between the block insertion point and the perpendicular point of the existing polyline.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've attached a very basic before/after which also hopefully demonstrates what I'm talking about.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To explain further, my block will have a z level of 0 and be placed adjacent to 'Polyline A' which will have a varying z level. So the command would need to first search for Polyline A within a pre-determined area, before drawing a new 3D polyline to connect the block to Polyline A.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&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;Matt&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2016 14:11:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/6333224#M132095</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-18T14:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: Draw polyline to nearest point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/6333528#M132096</link>
      <description>&lt;P&gt;Hello Matt,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm unfortunately still not fully clear on the problem, but I think it's safe that we can break the problem down into a few steps:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Looking for nearby polylines
&lt;UL&gt;
&lt;LI&gt;While you might try some kind of window selection, I think you're going to have to analyse the complete modelspace contents for this. If it's going to be an operation that's run repeatedly, you could maintain a spatial index of polylines in memory, so the 2nd run would be quicker.&lt;/LI&gt;
&lt;LI&gt;In LISP you'd use (ssget "X") and if in .NET Editor.SelectAll(); then it's all about processing the selection set...&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;Processing the polylines
&lt;UL&gt;
&lt;LI&gt;The analysis is likely to start with getting bounding boxes of the various polylines (which can be placed in an index, as mentioned above) and working out which are likely candidates. The analysis on the shortlist will involve working out the&amp;nbsp;closest point on the polyline to the block, which will give us the endpoint of the line to be created. This could be tricky, so I don't want to gloss over this step (it's the meat of the problem), but then as I'm not 100% clear on the problem statement, I can't really go into greater detail, at this stage.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;Drawing the line
&lt;UL&gt;
&lt;LI&gt;This is easy, at least.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;I noticed in the original thread that the choice of language isn't yet set in stone. If I were to try this, myself, I'd probably use .NET: mainly because of familiarity but also because of the geometry-related functions you have easier access to. You could do it in LISP, but it would personally take me longer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this is of some help... if I could get a better understanding of the exact problem, I might even be able to put together a quick blog post about it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kean&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2016 14:45:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/6333528#M132096</guid>
      <dc:creator>kean_walmsley</dc:creator>
      <dc:date>2016-05-18T14:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: Draw polyline to nearest point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/6338092#M132097</link>
      <description>&lt;P&gt;Hi Kean,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I apologise for the lack of clarity in my description; hopefully if I provide some context it may clear things up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am designing a highway drainage system, and will be running a main carrier pipe along the length of the highway (which is the long polyline in the drawing).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Into this pipe will be a number of gully pots ( replicated by a block with insertion point) and are&amp;nbsp;running adjacent to the pipe alebit at a different z-level.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I didn't have the use of a tool/script, I would have to go through each block and draw a 3d poline between the insertion pipe of the block and a perpendicular point on the main polyline (or pipe).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since there will be 100's of blocks across my proposal, I would like to create a command where I could choose the main polyline, then choose the blocks and the connection polylines would be drawn automatically. Perhaps I was trying to run before I could even walk, as such maybe we could remove the search function and simply have the user define the polyline with which to connect to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does this make things any clearer?&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;Matt&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2016 15:30:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/6338092#M132097</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-19T15:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: Draw polyline to nearest point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/6338119#M132098</link>
      <description>&lt;P&gt;Hi Matt,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the clarification - that helps me a lot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, absolutely - the very first step should probably be to select a polyline and a block and then create the line between the two. Then you can add the search piece once that's working properly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm a bit tied up for the next 10 days or so, but this is an interesting problem to look at. It might actually be easier than I think: GetClosestPointTo() on the polyline might just give the answer... (this is .NET rather than LISP, using the geometry library.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll see whether I sneak some&amp;nbsp;time to take a look at this over the coming days.&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;Kean&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2016 15:37:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/6338119#M132098</guid>
      <dc:creator>kean_walmsley</dc:creator>
      <dc:date>2016-05-19T15:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: Draw polyline to nearest point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/6338145#M132099</link>
      <description>&lt;P&gt;Hi Kean,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Excellent! As I say I am quite the novice with coding but I will go away and do some research on .net and see what I can come up with.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please don't let this distract you from your work but any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks very much&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2016 15:43:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/6338145#M132099</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-19T15:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: Draw polyline to nearest point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/6338262#M132100</link>
      <description>&lt;P&gt;Here's a basic command to get you started... (apologies to all for posting C# code in the LISP forum)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Runtime;

namespace ConnectBlockToPolyline
{
  public class Commands
  {
    [CommandMethod("B2P")]
    public static void Block2Polyline()
    {
      var doc = Application.DocumentManager.MdiActiveDocument;
      if (doc == null)
        return;

      var db = doc.Database;
      var ed = doc.Editor;

      // Get the block to connect

      var peo = new PromptEntityOptions("\nSelect the block");
      peo.SetRejectMessage("\nMust be a block.");
      peo.AddAllowedClass(typeof(BlockReference), false);

      var per = ed.GetEntity(peo);
      if (per.Status != PromptStatus.OK)
        return;

      var brId = per.ObjectId;

      var peo2 = new PromptEntityOptions("\nSelect the curve");
      peo2.SetRejectMessage("\nMust be a curve.");
      peo2.AddAllowedClass(typeof(Curve), false);

      var per2 = ed.GetEntity(peo2);
      if (per2.Status != PromptStatus.OK)
        return;

      var cId = per2.ObjectId;

      using (var tr = doc.TransactionManager.StartTransaction())
      {
        var br = tr.GetObject(brId, OpenMode.ForRead) as BlockReference;
        if (br != null)
        {
          var btr =
            tr.GetObject(
              SymbolUtilityServices.GetBlockModelSpaceId(db), OpenMode.ForWrite
            ) as BlockTableRecord;

          if (btr != null)
          {
            var c = tr.GetObject(cId, OpenMode.ForRead) as Curve;
            if (c != null)
            {
              var pt = c.GetClosestPointTo(br.Position, false);

              var ln = new Line(br.Position, pt);
              btr.AppendEntity(ln);
              tr.AddNewlyCreatedDBObject(ln, true);
            }
          }
        }
        tr.Commit();
      }
    }
  }
}
&lt;/PRE&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2016 16:19:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/6338262#M132100</guid>
      <dc:creator>kean_walmsley</dc:creator>
      <dc:date>2016-05-19T16:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: Draw polyline to nearest point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/6339973#M132101</link>
      <description>&lt;P&gt;Here's the first post in the series... I'll post the follow-up on Monday:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://through-the-interface.typepad.com/through_the_interface/2016/05/connecting-points-to-curves-by-the-shortest-distance-in-autocad-using-net-part-1.html" target="_blank"&gt;http://through-the-interface.typepad.com/through_the_interface/2016/05/connecting-points-to-curves-by-the-shortest-distance-in-autocad-using-net-part-1.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kean&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2016 12:01:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/6339973#M132101</guid>
      <dc:creator>kean_walmsley</dc:creator>
      <dc:date>2016-05-20T12:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: Draw polyline to nearest point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/6345669#M132102</link>
      <description>&lt;P&gt;Many thanks for your assistance, Kean.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've just seen your second post on the topic and it has been of great help, not only with the highway design but also in getting to grips with the language in general.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2016 09:55:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/6345669#M132102</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-24T09:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: Draw polyline to nearest point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/6346353#M132103</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was tweaking the code to insert a 3D polyline rather than a line which worked absolutely fine. I then tweaked it slightly to insert the 3D polyline at a certain distance below the insertion point of the block. The 3dpointcollection part now looks like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;var pts = new Point3dCollection();

                foreach (ObjectId id in refIds)
                {

                    var br = tr.GetObject(id, OpenMode.ForRead) as BlockReference;

                    Point3d pt3 = new Point3d(br.Position.X, br.Position.Y, br.Position.Z);
                    
                    pts.Add(pt3);

                };&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I write "br.Position.Z - 0.6" it correctly starts the 3D polyline 0.6m below the insertion point. However I would eventually like the user to be able to specify the vertical offset, rather than a fixed 0.6.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far I have written the following such that the user can select depth of two choices, but I can't get a way of changing the&amp;nbsp;'gdchkstring'&amp;nbsp;into a double so it can be subtracted from the block x position:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; var gd = new PromptKeywordOptions("\nSelect gully depth to invert");

            gd.AllowNone = true;
            gd.Keywords.Add("0.6");
            gd.Keywords.Add("0.75");
            gd.Keywords.Default = ("0.6");


            var gdchk = ed.GetKeywords(gd);


            if (gdchk.Status != PromptStatus.OK)
                return;

            string gdchkdstring = gdchk.ToString();&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&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;Matt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2016 15:04:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/6346353#M132103</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-24T15:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: Draw polyline to nearest point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/6346637#M132104</link>
      <description>&lt;P&gt;Hi Matt,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to convert a string to a double, try double.Parse(str). That said, you'd probably be better off using GetDouble(), unless you want to restrict to a set of options.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The other way to do it would be to present a set of options in a list, such as this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. 0.6&lt;/P&gt;
&lt;P&gt;2. 0.75&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And then use GetInteger() to get one of the items. This would work well if you have a long list of possible options, but want to make sure they choose from a list.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kean&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2016 16:53:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/6346637#M132104</guid>
      <dc:creator>kean_walmsley</dc:creator>
      <dc:date>2016-05-24T16:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: Draw polyline to nearest point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/6347835#M132105</link>
      <description>&lt;P&gt;Thanks Kean! All sorted!!!&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2016 08:37:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/6347835#M132105</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-25T08:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Draw polyline to nearest point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/14101563#M170874</link>
      <description>&lt;P&gt;I realize this forum post is nearly 10 years old, but if anyone knows, I attempted to create a LISP using this code and load it into C3D, but it didn't do anything. I'm not familiar with coding or anything either, so would you be able to elaborate as to how I can integrate and use this code?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2026 17:00:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/14101563#M170874</guid>
      <dc:creator>aalexanderCYWTH</dc:creator>
      <dc:date>2026-04-22T17:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: Draw polyline to nearest point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/14102023#M170883</link>
      <description>&lt;P&gt;The code by&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/77318"&gt;@kean_walmsley&lt;/a&gt;&amp;nbsp;"&lt;SPAN&gt;&lt;STRONG&gt;apologies to all for posting C# code in the LISP forum&lt;/STRONG&gt;" is not lisp so you would have to start again from scratch writing an equivalent in lisp. Maybe some one else has something.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2026 00:40:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/14102023#M170883</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2026-04-23T00:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: Draw polyline to nearest point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/14103854#M170892</link>
      <description>&lt;P&gt;Regards &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13957624"&gt;@aalexanderCYWTH&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this code&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(defun c:PlB (/ lsn p px)
  (princ "\nSelect block and polyline...")
  (setq lsn (vl-remove-if 'listp (mapcar 'cadr (ssnamex (ssget)))))
  (if (= (cdr (assoc 0 (entget (car lsn)))) "INSERT")
    (progn
      (setq p  (cdr (assoc 10 (entget (car lsn))))
            px (vlax-curve-getclosestpointto (cadr lsn) (trans p 1 0) t)
      )
      (command "_3dpoly" p px "")
    )
    (progn
      (setq p  (cdr (assoc 10 (entget (cadr lsn))))
            px (vlax-curve-getclosestpointto (car lsn) (trans p 1 0) t)
      )
      (command "_3dpoly" p px "")
    )
  )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 24 Apr 2026 04:24:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/14103854#M170892</guid>
      <dc:creator>calderg1000</dc:creator>
      <dc:date>2026-04-24T04:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: Draw polyline to nearest point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/14104121#M170894</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13957624"&gt;@aalexanderCYWTH&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another code that allows you to buffer one or more lightweight polylines and choose which block to connect in these areas.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2026 08:37:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-polyline-to-nearest-point/m-p/14104121#M170894</guid>
      <dc:creator>CADaSchtroumpf</dc:creator>
      <dc:date>2026-04-24T08:37:21Z</dc:date>
    </item>
  </channel>
</rss>

