<?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 Get a point of a polilyne in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9470921#M75458</link>
    <description>&lt;P&gt;Hi masters!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working in a new LISP, to change the dimensions of a drawing for an aligned dimension. Dimensions you can see in the drawing are made of simple lines.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, first of all i tried to identify the point nº3 of the triangles. After that i will make a dimensions between those 2.&lt;/P&gt;&lt;P&gt;I am stuck in this point and dont know how to get it. I imagine i need to identify the coordinates of those point. If anyone knows any other way to make it easier i will apreciate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How i will run the lisp? I will select only the items i need to change, and will run the lisp. I will do the same action again and again until all the dimensions are changed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is no need to create the dimstyle and layer, because both will be already created in the drawing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Sun, 26 Apr 2020 09:55:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-04-26T09:55:04Z</dc:date>
    <item>
      <title>Get a point of a polilyne</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9470921#M75458</link>
      <description>&lt;P&gt;Hi masters!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working in a new LISP, to change the dimensions of a drawing for an aligned dimension. Dimensions you can see in the drawing are made of simple lines.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, first of all i tried to identify the point nº3 of the triangles. After that i will make a dimensions between those 2.&lt;/P&gt;&lt;P&gt;I am stuck in this point and dont know how to get it. I imagine i need to identify the coordinates of those point. If anyone knows any other way to make it easier i will apreciate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How i will run the lisp? I will select only the items i need to change, and will run the lisp. I will do the same action again and again until all the dimensions are changed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is no need to create the dimstyle and layer, because both will be already created in the drawing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Sun, 26 Apr 2020 09:55:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9470921#M75458</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-26T09:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: Get a point of a polilyne</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9471393#M75459</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would you&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;do the same action again and again until all the dimensions are changed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;by picking each 2 triangle at the time??&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Apr 2020 16:11:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9471393#M75459</guid>
      <dc:creator>devitg</dc:creator>
      <dc:date>2020-04-26T16:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: Get a point of a polilyne</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9471744#M75460</link>
      <description>&lt;P&gt;Yes, i will repeat the same action again and again until all are done. Making it automatic will be hard (as sometimes the dimensions are inclined, and with my knowledge i dont know if that will be possible)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyways i just need to identify the 3rd point of those triangles, which are a polilyne&lt;/P&gt;</description>
      <pubDate>Sun, 26 Apr 2020 19:46:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9471744#M75460</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-26T19:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get a point of a polilyne</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9471816#M75461</link>
      <description>&lt;P&gt;It will be better to use GETPOINT, as such triangles have 6 vertex&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;;;;((16.1137 10.0344 0.0)
;;;  (16.0824 10.0344 0.0)
;;;  (16.1137 10.1182 0.0)
;;;  (16.1449 10.0344 0.0)
;;;  (16.1137 10.0344 0.0)
;;;  (16.1137 10.0344 0.0))&lt;/LI-CODE&gt;&lt;P&gt;so you can use&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;;IDENTIFY THE POINTS
  (setq p1 (getpoint "\nPick the point " ))
  (setq p2 (getpoint p1 "\nThe other point."))

             
;;;  (setq pt1 (list (car p1) (cadr p1))
;;;  (setq pt2 (list (car p2) (cadr p2))
  )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Apr 2020 20:41:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9471816#M75461</guid>
      <dc:creator>devitg</dc:creator>
      <dc:date>2020-04-26T20:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: Get a point of a polilyne</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9471882#M75462</link>
      <description>&lt;P&gt;I want to make it automatic. With getpoint you must select the points in the window.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Searching i found this function:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(setq e (nth 0 d))&lt;/PRE&gt;&lt;P&gt;Where 0 is the poisition of the list, and d is the list. Despite of this still dont know how to identify onlye the triangle&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Apr 2020 21:22:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9471882#M75462</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-26T21:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: Get a point of a polilyne</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9471972#M75463</link>
      <description>&lt;P&gt;try nth 2&lt;/P&gt;</description>
      <pubDate>Sun, 26 Apr 2020 22:23:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9471972#M75463</guid>
      <dc:creator>devitg</dc:creator>
      <dc:date>2020-04-26T22:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Get a point of a polilyne</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9472288#M75464</link>
      <description>&lt;P&gt;2 triangles 3 points each, do a furtherest distance apart will give the 2 outermost&amp;nbsp; points angle does not matter.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 03:48:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9472288#M75464</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2020-04-27T03:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: Get a point of a polilyne</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9472531#M75465</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What's the point in getting the triangle head vertex with (getpoint) when you can achieve the same result by directly running DIMALIGNED?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you can accomplish a task with standard command no lisp is needed - right?!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moshe&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 07:14:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9472531#M75465</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2020-04-27T07:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: Get a point of a polilyne</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9472845#M75466</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6254908"&gt;@Sea-Haven&lt;/a&gt;&amp;nbsp;, despite the triangle have 6 vertices, the OP also&amp;nbsp; want to erase both triangles and the POLYLINES between them after doing the ALIGNED DIM&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 10:00:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9472845#M75466</guid>
      <dc:creator>devitg</dc:creator>
      <dc:date>2020-04-27T10:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: Get a point of a polilyne</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9472954#M75467</link>
      <description>&lt;P&gt;This is a part of a more complex lisp i am working on. I need to select&amp;nbsp; and remove those lines. Thats why i want to make it automatic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the lisp i have updates. I am still stuck in the part where i get the points of the polilyne.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:co (/ ss s1 s2 p1 p2 pt1 pt2)

  (setq ss (ssget ()))
  (setq s1 (acet-ss-ssget-filter ss '((8 . "*_linea"))) ; I will delete this items later
	s2 (acet-ss-ssget-filter ss '((8 . "*_dist"))) ; I will delete this items later
	s3 (acet-ss-ssget-filter ss '((8 . "*_linea")(0 . "LWPOLYLINE,POLYLINE")(-4 . "&amp;amp;")(70 . 1))) ;Select only the triangles. Polilynes which are closed
  )
                      
;IDENTIFY THE POINTS
  (setq p1 ()
	p2 ()
  )
  (setq pt1 (nth 2 p1)
	pt2 (nth 2 p2)
  )
  
;DRAW DIMENSION
 (setvar "clayer" "_EST-ARM-REP")
 (setvar "dimstyle" "05-DCE-50-ARM")
 (command "_dimaligned" pt1 pt2 "")
  
;ERASE SELECTION 1 AND 2
 (command "_erase" s1 s2 "")
 (princ)
)


&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 11:06:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9472954#M75467</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-27T11:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get a point of a polilyne</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9473019#M75468</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What's the story of this drawing, from where it came? is it an option to ask the sender to fix this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Moshe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 11:37:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9473019#M75468</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2020-04-27T11:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Get a point of a polilyne</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9473172#M75469</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;So, first of all i tried to identify the point nº3 of the triangles. ....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;For that, it's a matter of (vlax-curve) Parameters, which start at 0 for the first vertex, just as (nth) uses 0 for the first item in a list and (ssname) uses 0 for the first object in the selection.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If &lt;FONT color="#000000"&gt;&lt;STRONG&gt;pl&lt;/STRONG&gt;&lt;/FONT&gt; is the entity name of the Polyline [gotten from something like, in your Message 10 code, &lt;FONT color="#000000"&gt;&lt;STRONG&gt;(ssname s3 &lt;FONT color="#00CCFF"&gt;&lt;EM&gt;somenumber&lt;/EM&gt;&lt;/FONT&gt;)&lt;/STRONG&gt;&lt;/FONT&gt;], this will give you the 3rd vertex at the point of the arrow:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;(vlax-curve-getPointAtParam pl 2)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But that depends on the arrow always being a 5-vertex construction like that, with the point at the 3rd vertex.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make sure you have running Osnap off, or build in "none" Osnap calls when you use those points in a dimensioning command.&amp;nbsp; And include the line&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;(vl-load-com)&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;in the command definition if that isn't done for you elsewhere.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 12:34:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9473172#M75469</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2020-04-27T12:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: Get a point of a polilyne</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9473459#M75470</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;you post about the same topic before : at&amp;nbsp;‎04-01-2020 04:16 PM&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/place-a-dimension-between-2-point/m-p/9231129" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/place-a-dimension-between-2-point/m-p/9231129&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and never give a like or&amp;nbsp; comment&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 13:59:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9473459#M75470</guid>
      <dc:creator>devitg</dc:creator>
      <dc:date>2020-04-27T13:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: Get a point of a polilyne</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9474147#M75471</link>
      <description>&lt;P&gt;Thanks for your help&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;, but it didnt work at all.&lt;/P&gt;&lt;P&gt;The triangles i wanna select are always a 2D polilyne and always have 5 vertices.&lt;/P&gt;&lt;P&gt;First of all i converted the selection (which are 2 triangles) into a Vla-object, then i tried to get the points as you described. What did i do wrong? Osnap is off.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"error: wrong argument type: lentityp &amp;lt;Selection set: 3732"&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;LI-CODE lang="general"&gt;(defun c:co (/ ss s1 s2 s3 s4 p1 p2 pt1 pt2)
(vl-load-com)
  (setq ss (ssget ()))
  (setq s1 (acet-ss-ssget-filter ss '((8 . "*_linea"))) 
	s2 (acet-ss-ssget-filter ss '((8 . "*_dist"))) 
	s3 (acet-ss-ssget-filter ss '((8 . "*_linea")(0 . "LWPOLYLINE,POLYLINE")(-4 . "&amp;amp;")(70 . 1))) 
	s4 (vlax-ename-&amp;gt;vla-object s3)
  )                      
;IDENTIFY THE POINTS
  (setq p1 (car s4)
	p2 (cdr s4)
  )
  (setq pt1 (vlax-curve-getPointAtParam p1 2)
	pt2 (vlax-curve-getPointAtParam p2 2)
  )
  
;DRAW DIMENSION
 (setvar "clayer" "_EST-ARM-REP")
 (command "_dimaligned" pt1 pt2 "")
  
;ERASE SELECTION 1 AND 2
 (command "_erase" s1 s2 "")
 (princ)
)&lt;/LI-CODE&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;Thanks for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 17:38:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9474147#M75471</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-27T17:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: Get a point of a polilyne</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9474184#M75472</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks for your help&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;, but it didnt work at all.&lt;/P&gt;
&lt;P&gt;The triangles i wanna select are always a 2D polilyne and always have 5 vertices.&lt;/P&gt;
&lt;P&gt;First of all i converted the selection (which are 2 triangles) into a Vla-object, then i tried to get the points as you described. What did i do wrong? Osnap is off.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;....
	s3 (acet-ss-ssget-filter ss '((8 . "*_linea")(0 . "LWPOLYLINE,POLYLINE")(-4 . "&amp;amp;")(70 . 1))) 
	s4 (vlax-ename-&amp;gt;vla-object s3)
  )                      
;IDENTIFY THE POINTS
  (setq p1 (car s4)
	p2 (cadr s4)
  )
  (setq pt1 (vlax-curve-getPointAtParam p1 2)
	pt2 (vlax-curve-getPointAtParam p2 2)
  )
....&lt;/LI-CODE&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If s3 is a &lt;EM&gt;selection set&lt;/EM&gt;, you can't make a VLA object out of that -- it needs to be an &lt;EM&gt;entity name&lt;/EM&gt;.&amp;nbsp; So your s4 setting is incorrect.&amp;nbsp; I think you could omit s4 altogether, and say:&lt;/P&gt;
&lt;P&gt;(setq &lt;FONT color="#000000"&gt;&lt;STRONG&gt;p1 (ssname s3 0) p2 (ssname s3 1)&lt;/STRONG&gt;&lt;/FONT&gt;)&lt;/P&gt;
&lt;P&gt;and go from there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The (vlax-curve-...) functions can take an entity name -- they don't require a VLA object.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 17:38:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9474184#M75472</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2020-04-27T17:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Get a point of a polilyne</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9474365#M75473</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;....
	s3 (acet-ss-ssget-filter ss '((8 . "*_linea")(0 . "LWPOLYLINE,POLYLINE")(-4 . "&amp;amp;")(70 . 1))) 
	s4 (vlax-ename-&amp;gt;vla-object s3)
  )                      
;IDENTIFY THE POINTS
  (setq p1 (car s4)
	p2 (cadr s4)
  )
....&lt;/LI-CODE&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If s3 is a &lt;EM&gt;selection set&lt;/EM&gt;, you can't make a VLA object out of that -- it needs to be an &lt;EM&gt;entity name&lt;/EM&gt;.&amp;nbsp; So your s4 setting is incorrect.&amp;nbsp; ...&lt;SPAN style="font-family: inherit;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In addition, if your idea was that &lt;FONT color="#000000"&gt;&lt;STRONG&gt;s4&lt;/STRONG&gt;&lt;/FONT&gt; would be a &lt;EM&gt;selection set&lt;/EM&gt;&amp;nbsp; containing &lt;EM&gt;VLA objects&lt;/EM&gt;&amp;nbsp; [which it can't be -- selection sets contain &lt;EM&gt;entity names&lt;/EM&gt;], then using &lt;STRONG&gt;&lt;FONT color="#000000"&gt;(car s4)&lt;/FONT&gt; &lt;/STRONG&gt;and &lt;STRONG&gt;&lt;FONT color="#000000"&gt;(cadr s4)&lt;/FONT&gt; &lt;/STRONG&gt;to get the two arrowheads out of it is also incorrect.&amp;nbsp; Those functions are for getting the 1st and 2nd things from a &lt;EM&gt;list&lt;/EM&gt;, not from a &lt;EM&gt;selection set&lt;/EM&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 18:44:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9474365#M75473</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2020-04-27T18:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Get a point of a polilyne</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9474402#M75474</link>
      <description>&lt;P&gt;Thank you so much&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp; for your help!! that worked!&lt;/P&gt;&lt;P&gt;I also found another mistake in the list: to put a dimension i needed 3 point, so i get the 3rd point in the middle of the pt1 and pt2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will leave the lisp here just i case anyone needs it in the future:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:co (/ ss s1 s2 s3 p1 p2 pt1 pt2 pt3 x y)
(vl-load-com)
  (setq ss (ssget ()))
  (setq s1 (acet-ss-ssget-filter ss '((8 . "*_linea"))) 
	s2 (acet-ss-ssget-filter ss '((8 . "*_dist"))) 
	s3 (acet-ss-ssget-filter ss '((8 . "*_linea")(0 . "LWPOLYLINE,POLYLINE")(-4 . "&amp;amp;")(70 . 1))) 
  )                      
;IDENTIFY THE POINTS
  (setq p1 (ssname s3 0)
	p2 (ssname s3 1)
  )
  (setq pt1 (vlax-curve-getPointAtParam p1 2)
	pt2 (vlax-curve-getPointAtParam p2 2)
  )
;GET MIDDLE POINT (PT3)
  (setq x (/ (+ (car pt1) (car pt2)) 2)
	y (/ (+ (cadr pt1) (cadr pt2)) 2)
	z (/ (+ (caddr pt1) (caddr pt2)) 2)
        pt3 (list x y z)
  )
;DRAW DIMENSION
 (setvar "clayer" "_EST-ARM-REP")
 (command "_dimaligned" pt1 pt2 pt3)
  
;ERASE SELECTION 1 AND 2
 (command "_erase" s1 s2 "")
 (princ)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 19:05:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9474402#M75474</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-27T19:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: Get a point of a polilyne</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9474950#M75475</link>
      <description>&lt;P&gt;I think that the point of a polyline is to be able to join lines and arcs together into one continuous entity that can even be closed and offset as a whole.&amp;nbsp; They are great for contours and property boundaries.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 00:19:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9474950#M75475</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2020-04-28T00:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: Get a point of a polilyne</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9476038#M75476</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp; hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Even though you closed this,&amp;nbsp; here is the&amp;nbsp;&lt;SPAN&gt;ultimate solution you can get&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;&lt;P&gt;command called CUSDIM (custom dimension) and it validates the triangles for it's vertices\edges and been an i&lt;SPAN&gt;sosceles triangle, eliminating redundant vertices and if something been wrong, you will be alerted.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;with CUSDIM you won't be worried about the head vertex been the 3rd point. it will be found no matter how the polyline was drawn&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;the program start by declaring 2 constants:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(setq  LINEAR_FUZZ 1e-3)
(setq ANGULAR_FUZZ 1e-5)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;the (equal) function is used a lot to verifies points and angles been equals in limit. if the accuracy level is not enough for you, increase (or decrease) these constants. LINEAR_FUZZ is for points and ANGULAR_FUZZ is for angles.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;another constant you would like to set is the dimension line offset distance (how far the dimension line is placed from the triangles):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(setq DL_OSET_DIST (* (getvar "dimtxt") (getvar "dimscale") 4))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;as you can see it is 4 times DIMTXT under the current dimstyle. if it is too close\far change it as needed.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;the program does not handles the dimension style (which is very important) or layer, these are left for you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if the triangles lays for horizontal\vertical dimension they will be drawn with DIMLINEAR otherwise it will be DIMALIGNED.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;enjoy&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Moshe&lt;/SPAN&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;LI-CODE lang="general"&gt;;;; cusdim.lsp
;;; Custom Dimension command
;;; by Moshe.A
;;; APR 28, 2020

(vl-load-com) ; load activex support

(defun c:cusdim (/ get_vertices elim_zero_seg elim_cont_seg get_head_vertex pos_dimlin ; local funcrions
                   LINEAR_FUZZ ANGULAR_FUZZ DL_OSET_DIST ss lst0 lst1 p0 p1 ;| local variables |;)
 
 (defun get_vertices (ename / l lst)
  (setq l (fix (vlax-curve-getEndParam ename))) 
  (repeat l
   (setq lst (cons (vlax-curve-getPointAtParam ename (setq l (1- l))) lst))
  ); repeat

  lst  
 ); get_vertices
 
 ; eliminate zero distance segments 
 (defun elim_zero_seg (lst / points)
  (while (not
            (vl-every
              '(lambda (t0 t1)
                 (if (not (equal (distance t0 t1) 0.0 LINEAR_FUZZ))
                  (setq points (cons t0 points))
                 ); if 
               )
               lst
               (cdr (append lst (list (car lst))))
            ); vl-every
         ); not
   (setq lst points points nil)
  ); while

  points
 ); elim_zero_seg
  
 ; eliminate continuing segments
 (defun elim_cont_seg (lst / points)
  (while (not
           (vl-every
            '(lambda (t0 t1 t2)
              (if (not (equal (angle t0 t1) (angle t1 t2) ANGULAR_FUZZ))
               (setq points (cons t1 points))
              ); if
             ); lambda
             lst
             (cdr  (append lst (list (car lst))))
             (cddr (append lst (list (car lst)) (list (cadr lst))))
           ); vl-every
         ); not
   (setq lst points points nil)
  ); while

  (if (= (vl-list-length lst) 3)
   points 
   (progn
    (vlr-beep-reaction) 
    (alert "error: invalid triangle selected.")
   ); progn
  ); if
 ); elim_cont_seg
  
 (defun get_head_vertex (lst / angleAtVertices angle_sum ; local functions
                               dataL)

  (defun angleAtVertices (/ qang) ; local function

   (defun qang (a0 a1 / a2)
    (if (&amp;gt; a0 a1) 
     (setq a2 (- a0 a1))
     (setq a2 (- a1 a0))
    )

    (if (&amp;gt; a2 pi)
     (- (* pi 2) a2)
     a2 
    )  
   ); qang
    
   (mapcar
    '(lambda (t0 t1 t2)
      (cons (qang (angle t1 t0) (angle t1 t2)) (list t1))
     )
     lst
     (cdr  (append lst (list (car lst))))
     (cddr (append lst (list (car lst)) (list (cadr lst))))
    ); mapcar
  ); angleAtVertices
   
  (defun angle_sum () 
   (apply
     '+
     (mapcar
      '(lambda (d)
        (car d) 
       )
      dataL
     ); mapcar
   ); apply
  ); angle_sum
    
  ; here start (get_head_vertex)
  (setq dataL (angleAtVertices))
   
  (cond
   ((not (equal (angle_sum) pi ANGULAR_FUZZ))
    (vlr-beep-reaction)
    (alert "error: invalid triangle selected.")
   ); case
   ((equal (car (nth 0 dataL)) (car (nth 1 dataL)) ANGULAR_FUZZ)
    (cadr (nth 2 dataL))
   )
   ((equal (car (nth 0 dataL)) (car (nth 2 dataL)) ANGULAR_FUZZ)
    (cadr (nth 1 dataL))
   )
   ((equal (car (nth 1 dataL)) (car (nth 2 dataL)) ANGULAR_FUZZ)
    (cadr (nth 0 dataL))
   )
   ( t ; not isosceles triangle
    (vlr-beep-reaction)
    (alert "error: invalid triangle selected.")
   )
  ); cond
 ); get_head_vertex

 ; position dimension line 
 (defun pos_dimlin (t0 t1 / ax cx ang0 ang1)
  (setq ang0 (angle t0 t1)) 
  (setq ax (/ (distance t0 t1) 2))
  (setq cx (sqrt (+ (expt ax 2) (expt DL_OSET_DIST 2))))
  (setq ang1 (atan (/ DL_OSET_DIST ax)))
   
  (if (and
        (&amp;gt; ang0 (* pi 0.5))
        (&amp;lt; ang0 (* pi 1.5))
      )
   (polar t0 (+ ang0 ang1) cx)
   (polar t0 (- ang0 ang1) cx)
  ); if
 ); pos_dimlin

 ; here start (c:cusdim)
 (setvar "cmdecho" 0)

 ; declare some constants 
 (setq  LINEAR_FUZZ 1e-3)
 (setq ANGULAR_FUZZ 1e-5)
 ; dimension line offset distance 
 (setq DL_OSET_DIST (* (getvar "dimtxt") (getvar "dimscale") 4))
  
 (if  (and
       (setq ss (ssget '((0 . "*polyline") (70 . 1)))) ; filter closed AcDb2dPolyline and\or AcDbPolyline
       (= (sslength ss) 2)			       ; only 2 objects allowed
      )
   (if (and
        (setq lst0 (elim_zero_seg (get_vertices (ssname ss 0))))
        (setq lst1 (elim_cont_seg lst0))
        (setq p0 (get_head_vertex lst1))
        (setq lst0 (elim_zero_seg (get_vertices (ssname ss 1))))
        (setq lst1 (elim_cont_seg lst0))
        (setq p1 (get_head_vertex lst1))
      )
    (cond
     ((or
        (equal (car  p0) (car  p1) LINEAR_FUZZ)
        (equal (cadr p0) (cadr p1) LINEAR_FUZZ)
      )
      (command "._dimlinear" "_None" p0 "_None" p1 "_None" (pos_dimlin p0 p1))
     ); case
     ( t
      (command "._dimaligned" "_None" p0 "_None" p1 "_None" pos_dimlin p0 p1))
     )
    ); cond
   ); if
 ); if

 (setvar "cmdecho" 1)
  (princ) 
); c:cusdim
  &lt;/LI-CODE&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;&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;&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>Tue, 28 Apr 2020 10:58:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9476038#M75476</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2020-04-28T10:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Get a point of a polilyne</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9476177#M75477</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;... to put a dimension i needed 3 point, so i get the 3rd point in the middle of the pt1 and pt2&lt;/P&gt;
&lt;P&gt;….&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;....
;GET MIDDLE POINT (PT3)
  (setq x (/ (+ (car pt1) (car pt2)) 2)
	y (/ (+ (cadr pt1) (cadr pt2)) 2)
	z (/ (+ (caddr pt1) (caddr pt2)) 2)
        pt3 (list x y z)
  )
....&lt;/LI-CODE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;For that part, here's a more concise way to do it, without separate variables for each coordinate:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;(setq pt3 (mapcar '/ (mapcar '+ pt1 pt2) '(2 2 2)))&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The inner [second] (mapcar) function adds the coordinates in each direction of the two points together all in one operation, and the outer [first] one divides the values of those sums by 2 each.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 11:56:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-a-point-of-a-polilyne/m-p/9476177#M75477</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2020-04-28T11:56:06Z</dc:date>
    </item>
  </channel>
</rss>

