<?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: Detect if selected point of polyline is its a vertex - how? in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/detect-if-selected-point-of-polyline-is-its-a-vertex-how/m-p/3328601#M57261</link>
    <description>&lt;P&gt;Hi Felix,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I deeply disagree, you can obtain the&amp;nbsp;&lt;STRONG&gt;NumberOfVertices &lt;/STRONG&gt;property of the &lt;STRONG&gt;&lt;SPAN&gt;Polyline&lt;/SPAN&gt;&lt;/STRONG&gt; object and then get the point at each vertex with&amp;nbsp;&lt;STRONG&gt;GetPoint3dAt&amp;nbsp;&lt;/STRONG&gt;using the vertex index, in the same way as with&amp;nbsp;&lt;STRONG&gt;GetPointAtParameter &lt;/STRONG&gt;(the vertex are positioned at increments of 1 from the start parameter to the end parameter, no matter if there are arcs in between)&lt;STRONG&gt;. &lt;/STRONG&gt;The curve class and its derivates has a lot of methods to obtain data from its geometry, properties and structure without the need to explode the objects. Jus check it, no more than 10 lines of code (other than doc,db,transaction, etc).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gaston Nunez&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 11 Feb 2012 17:39:58 GMT</pubDate>
    <dc:creator>hgasty1001</dc:creator>
    <dc:date>2012-02-11T17:39:58Z</dc:date>
    <item>
      <title>Detect if selected point of polyline is its a vertex - how?</title>
      <link>https://forums.autodesk.com/t5/net-forum/detect-if-selected-point-of-polyline-is-its-a-vertex-how/m-p/3327943#M57257</link>
      <description>&lt;P&gt;Hello!&lt;BR /&gt;&lt;BR /&gt;I would like to know if there is any way to detect if selected point of the selected polyline is its vertex?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. The user is drawing rectangle or any other figure with polyline.&lt;/P&gt;&lt;P&gt;2. Entering command "GetMe".&lt;/P&gt;&lt;P&gt;3. Selecting polyline.&lt;/P&gt;&lt;P&gt;4. Selecting point.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any built-in function in Autodesk's API?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2012 21:02:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/detect-if-selected-point-of-polyline-is-its-a-vertex-how/m-p/3327943#M57257</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-10T21:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: Detect if selected point of polyline is its a vertex - how?</title>
      <link>https://forums.autodesk.com/t5/net-forum/detect-if-selected-point-of-polyline-is-its-a-vertex-how/m-p/3328149#M57258</link>
      <description>&lt;P&gt;hi, i think there is not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;therefore&amp;nbsp;i think you have&amp;nbsp;to&amp;nbsp;either collect the points from user to start off with or explode the poly and collect start and endpts, and then compare each to the pickedpoint from the entity selection result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;felix&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2012 22:17:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/detect-if-selected-point-of-polyline-is-its-a-vertex-how/m-p/3328149#M57258</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-10T22:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Detect if selected point of polyline is its a vertex - how?</title>
      <link>https://forums.autodesk.com/t5/net-forum/detect-if-selected-point-of-polyline-is-its-a-vertex-how/m-p/3328357#M57259</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You don't need to explode the polyline, just iterate the parameters, get the point at each parameter value and add it to a Point3dCollection and then check if the picked point is in the collection. By other side i believe it's *very* dificult for a user to pick exactly in a vertex without osnap, and so I think you need a tolerance to check the the distance from the picked point to the vertex for each one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim pcol As New Point3dCollection&lt;BR /&gt;Dim fp, lp As Double&lt;/P&gt;&lt;P&gt;fp = pline.StartParam&lt;BR /&gt;lp = pline.EndParam&lt;/P&gt;&lt;P&gt;For i = fp To lp&lt;BR /&gt;&amp;nbsp;pcol.Add(pline.GetPointAtParameter(i))&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'Aproach 1&lt;/P&gt;&lt;P&gt;If pcol.Contains(PickedPoint) then&lt;/P&gt;&lt;P&gt;&amp;nbsp;...&lt;/P&gt;&lt;P&gt;Else&lt;/P&gt;&lt;P&gt;&amp;nbsp;...&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'Aproach 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For each p as Point3D in pcol&lt;/P&gt;&lt;P&gt;&amp;nbsp;If p.DistanceTo(Pickedpoint) &amp;lt;= Tolerance then&lt;/P&gt;&lt;P&gt;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp; Exit For&lt;/P&gt;&lt;P&gt;&amp;nbsp;Else&lt;/P&gt;&lt;P&gt;&amp;nbsp; ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;End If&lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gaston Nunez&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Feb 2012 04:24:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/detect-if-selected-point-of-polyline-is-its-a-vertex-how/m-p/3328357#M57259</guid>
      <dc:creator>hgasty1001</dc:creator>
      <dc:date>2012-02-11T04:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: Detect if selected point of polyline is its a vertex - how?</title>
      <link>https://forums.autodesk.com/t5/net-forum/detect-if-selected-point-of-polyline-is-its-a-vertex-how/m-p/3328551#M57260</link>
      <description>&lt;P&gt;hi gaston&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;exploding simply allows you to separate the polyline into its individual sections, lines or arcs, bulge or not etc,&amp;nbsp;which gives you the sought of vertices.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with no tolerance there's an infinite amount of parameter values in a curve; with tolerance you still don't know whether or not any parameter value&amp;nbsp;happens to be&amp;nbsp;one of the polyline's vertices. i agree, with regards to point3d-accuracy and tolerance,&amp;nbsp;it matters whether or not&amp;nbsp;grip selection is enabled for selection, however,&amp;nbsp;i don't think this applies to the prompt entity selection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;apart from start and endpoint, the polyline's vertices, e.g. number and location, once it is a dbobject are not known. the polyline has a .getlineat(integer) method which looks appropriate enough to get to the vertices, however, the integer iteration maximum is, i believe, not known. and also, it only works if the section is in fact a line section&amp;nbsp;as opposed to&amp;nbsp;an arc section. exploding simply allows bypassing the information surrounding the vertices, and the original polyline is retained (unless it is explicitly erased separately).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;felix&lt;/P&gt;</description>
      <pubDate>Sat, 11 Feb 2012 15:49:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/detect-if-selected-point-of-polyline-is-its-a-vertex-how/m-p/3328551#M57260</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-11T15:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Detect if selected point of polyline is its a vertex - how?</title>
      <link>https://forums.autodesk.com/t5/net-forum/detect-if-selected-point-of-polyline-is-its-a-vertex-how/m-p/3328601#M57261</link>
      <description>&lt;P&gt;Hi Felix,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I deeply disagree, you can obtain the&amp;nbsp;&lt;STRONG&gt;NumberOfVertices &lt;/STRONG&gt;property of the &lt;STRONG&gt;&lt;SPAN&gt;Polyline&lt;/SPAN&gt;&lt;/STRONG&gt; object and then get the point at each vertex with&amp;nbsp;&lt;STRONG&gt;GetPoint3dAt&amp;nbsp;&lt;/STRONG&gt;using the vertex index, in the same way as with&amp;nbsp;&lt;STRONG&gt;GetPointAtParameter &lt;/STRONG&gt;(the vertex are positioned at increments of 1 from the start parameter to the end parameter, no matter if there are arcs in between)&lt;STRONG&gt;. &lt;/STRONG&gt;The curve class and its derivates has a lot of methods to obtain data from its geometry, properties and structure without the need to explode the objects. Jus check it, no more than 10 lines of code (other than doc,db,transaction, etc).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gaston Nunez&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Feb 2012 17:39:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/detect-if-selected-point-of-polyline-is-its-a-vertex-how/m-p/3328601#M57261</guid>
      <dc:creator>hgasty1001</dc:creator>
      <dc:date>2012-02-11T17:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: Detect if selected point of polyline is its a vertex - how?</title>
      <link>https://forums.autodesk.com/t5/net-forum/detect-if-selected-point-of-polyline-is-its-a-vertex-how/m-p/3328653#M57262</link>
      <description>&lt;P&gt;well, you are right, i've overlooked the polyline.numberofvertices property, and yes, i agree that traversing the polyline to collect the points is probably more elegant than exploding it, provided that&amp;nbsp;that&amp;nbsp;fits in with&amp;nbsp;the overall task.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;going back to the original question however, the polyline hasn't got a method of comparing a pickedpoint to its vertices, i.e. the points still need to be collected and traversed for comparison whichever way its done. so,&amp;nbsp;holding onto&amp;nbsp;the user's initial input points may still be advantagous (together with a tolerance for the pickedpoint property).&lt;/P&gt;</description>
      <pubDate>Sat, 11 Feb 2012 19:30:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/detect-if-selected-point-of-polyline-is-its-a-vertex-how/m-p/3328653#M57262</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-11T19:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Detect if selected point of polyline is its a vertex - how?</title>
      <link>https://forums.autodesk.com/t5/net-forum/detect-if-selected-point-of-polyline-is-its-a-vertex-how/m-p/3328857#M57263</link>
      <description>&lt;P&gt;For polyline is true that rule: if&amp;nbsp; &lt;STRONG&gt;&lt;SPAN style="color: #660000;"&gt;GetParameterAtPoint &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #660000;"&gt;method return value equal integer - then that integer is a index of polyline vertex (zero based).&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Feb 2012 15:42:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/detect-if-selected-point-of-polyline-is-its-a-vertex-how/m-p/3328857#M57263</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2012-02-12T15:42:18Z</dc:date>
    </item>
  </channel>
</rss>

