<?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: How to get the distance between two points with C# in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/how-to-get-the-distance-between-two-points-with-c/m-p/8850960#M22110</link>
    <description>&lt;P&gt;Nice example Gilles.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sonny,&lt;/P&gt;&lt;P&gt;Because the example uses dynamic ;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;FONT color="#00CCFF"&gt;&lt;EM&gt;&lt;SPAN class="importanttitle"&gt;Important:&lt;/SPAN&gt;&amp;nbsp;When working with DLR and C#, you will need to reference the Microsoft.CSharp library.&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;A href="https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-NET/files/GUID-F2A96EC2-B693-498E-8425-258A0CE3653F-htm.html" target="_blank" rel="noopener"&gt;https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-NET/files/GUID-F2A96EC2-B693-498E-8425-258A0CE3653F-htm.html&lt;/A&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;</description>
    <pubDate>Thu, 13 Jun 2019 22:06:26 GMT</pubDate>
    <dc:creator>kerry_w_brown</dc:creator>
    <dc:date>2019-06-13T22:06:26Z</dc:date>
    <item>
      <title>How to get the distance between two points with C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-get-the-distance-between-two-points-with-c/m-p/8850453#M22108</link>
      <description>&lt;P&gt;The problem is that a user needs to select a block the select a point on that block where he wants a leader to be placed.&amp;nbsp; I need to be able to tell how far from the block insertion point is the point where he wants the leader to be placed regardless of the rotation of the block or the orientation of the UCS.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been chasing my tail on this for two days and I just don't know how to do this.&amp;nbsp; Anyone got a suggestion?&amp;nbsp; All help is appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sonny&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 18:08:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-get-the-distance-between-two-points-with-c/m-p/8850453#M22108</guid>
      <dc:creator>sonny3g</dc:creator>
      <dc:date>2019-06-13T18:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the distance between two points with C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-get-the-distance-between-two-points-with-c/m-p/8850897#M22109</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You simply need to get the BlockReference.Position which is always WCS defined and transform the point returned by PromptPointResult.Value to WCS coordinates because it's always UCS defined.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;            var ed = Application.DocumentManager.MdiActiveDocument.Editor;
            var peo = new PromptEntityOptions("\nSelect block: ");
            peo.SetRejectMessage("\nMust be a block.");
            peo.AddAllowedClass(typeof(BlockReference), true);
            var per = ed.GetEntity(peo);
            if (per.Status == PromptStatus.OK)
            {
                var ppr = ed.GetPoint("\nSpecify a point: ");
                if (ppr.Status == PromptStatus.OK)
                {
                    dynamic br = per.ObjectId;
                    var position = br.Position;
                    var point = ppr.Value.TransformBy(ed.CurrentUserCoordinateSystem);
                    var distance = point.DistanceTo(position);
                    ed.WriteMessage("\nDistance = {0}", distance);
                }
            }&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Jun 2019 21:33:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-get-the-distance-between-two-points-with-c/m-p/8850897#M22109</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2019-06-13T21:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the distance between two points with C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-get-the-distance-between-two-points-with-c/m-p/8850960#M22110</link>
      <description>&lt;P&gt;Nice example Gilles.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sonny,&lt;/P&gt;&lt;P&gt;Because the example uses dynamic ;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;FONT color="#00CCFF"&gt;&lt;EM&gt;&lt;SPAN class="importanttitle"&gt;Important:&lt;/SPAN&gt;&amp;nbsp;When working with DLR and C#, you will need to reference the Microsoft.CSharp library.&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;A href="https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-NET/files/GUID-F2A96EC2-B693-498E-8425-258A0CE3653F-htm.html" target="_blank" rel="noopener"&gt;https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-NET/files/GUID-F2A96EC2-B693-498E-8425-258A0CE3653F-htm.html&lt;/A&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;</description>
      <pubDate>Thu, 13 Jun 2019 22:06:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-get-the-distance-between-two-points-with-c/m-p/8850960#M22110</guid>
      <dc:creator>kerry_w_brown</dc:creator>
      <dc:date>2019-06-13T22:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the distance between two points with C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-get-the-distance-between-two-points-with-c/m-p/8852409#M22111</link>
      <description>&lt;P&gt;Thanks _kdub,&lt;/P&gt;&lt;P&gt;I will take some time out to read through the article in the link you provided.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sonny&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2019 16:07:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-get-the-distance-between-two-points-with-c/m-p/8852409#M22111</guid>
      <dc:creator>sonny3g</dc:creator>
      <dc:date>2019-06-14T16:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the distance between two points with C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-get-the-distance-between-two-points-with-c/m-p/8852413#M22112</link>
      <description>&lt;P&gt;Thanks Giles, as always you come through with a solution!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sonny&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2019 16:07:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-get-the-distance-between-two-points-with-c/m-p/8852413#M22112</guid>
      <dc:creator>sonny3g</dc:creator>
      <dc:date>2019-06-14T16:07:53Z</dc:date>
    </item>
  </channel>
</rss>

