<?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: End Points of 3dSolid Cylinder in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5791761#M139015</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;The cylinders represent a pipeline of any length and can be drawn in any direction 3-dimensionally. My goal is to find the end points of each cylinder and cut the cylinders into specific segments. Example - cut a pipe to 8' lengths with leftover at 1 end. This is why I need the endpoints of the center of the cylinders so I can calculate points along the axis of the cylinders. Note - the cylinders will always be straight segments. I don't have to worry about elbows or bends.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;mracad,&lt;/P&gt;
&lt;P&gt;I don't deal with CADWorx pipes, but if your goal is &lt;EM&gt;'&amp;nbsp;I need the endpoints of the center of the cylinders so I can calculate points along the axis of the cylinders.'&lt;/EM&gt;, we can use the&amp;nbsp;XDATA...&lt;/P&gt;
&lt;P&gt;This &lt;SPAN class="hps"&gt;quick&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;and dirty&lt;/SPAN&gt;&amp;nbsp;'demo' will entmake a center line at selected solids&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:demo (/ en i lst ss)
   (if (setq ss (ssget '((0 . "3DSOLID") (-3 ("CPD1")))))
      (repeat (setq i (sslength ss))
         (setq ent (entget (ssname ss (setq i (1- i))) '("CPD1")))
         (setq lst (vl-remove-if-not '(lambda (x) (= (car x) 1011)) (cdr (car (cdr (assoc -3 ent))))))
         (entmake (list '(0 . "LINE")
                        '(8 . "__Demo")
                        (cons 10 (cdr (nth 0 lst)))
                        (cons 11 (cdr (nth 1 lst)))
                  )
         )
      )
   )
   (princ)
)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps, &lt;BR /&gt;Henrique&lt;/P&gt;</description>
    <pubDate>Thu, 27 Aug 2015 16:26:09 GMT</pubDate>
    <dc:creator>hmsilva</dc:creator>
    <dc:date>2015-08-27T16:26:09Z</dc:date>
    <item>
      <title>End Points of 3dSolid Cylinder</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5785476#M139006</link>
      <description>&lt;P&gt;I am trying to get the end points of a 3dSolid cylinder.&lt;/P&gt;
&lt;P&gt;The cylinders can be in any direction 3 dimensionally.&lt;/P&gt;
&lt;P&gt;I just don't have a clue how to transform the PrincipalDirections, etc. into a centroid point and then into vectors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Aug 2015 19:17:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5785476#M139006</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-24T19:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: End Points of 3dSolid Cylinder</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5785573#M139007</link>
      <description>&lt;P&gt;CENter Object Snap will get them for you. &amp;nbsp;If you want a &lt;EM&gt;routine&lt;/EM&gt; to find them, entity data for 3D Solids is so inscrutable that I don't know how to get anything from that, but if you "dump" the cylinder's VLA Properties, you'll see several that look like point lists -- Centroid, MomentOfInertia, PrincipalMoments, RadiiOfGyration -- that you could experiment with. &amp;nbsp;The Centroid is clear enough, though the Property needs conversion:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(vlax-safearray-&amp;gt;list (vlax-variant-value&amp;nbsp;(vla-get-Centroid (vlax-ename-&amp;gt;vla-object &lt;FONT color="#33CCCC"&gt;&lt;EM&gt;YourCylinderEntityName&lt;/EM&gt;&lt;/FONT&gt;))))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Doing the same with the PrincipalDirections Property gives a list of 9 numbers, presumably making three vectors relative to the Centroid, but you'd need to play with them, probably adding them to the Centroid with (mapcar), and/or possibly using (trans) on them, to get the results you want.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Aug 2015 20:19:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5785573#M139007</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2015-08-24T20:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: End Points of 3dSolid Cylinder</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5785760#M139008</link>
      <description>&lt;P&gt;One end of the cylinder axis is its position property. &amp;nbsp;The centroid property is the midpoint of its axis. &amp;nbsp;To get to the other end, find the dx,dy,dz between those 2 points and add twice the dx,dy, and dz to get to the other end. &amp;nbsp;If you really need a program, open the spoiler.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;LI-SPOILER&gt;;returns a list of points describing a cylinder's axis&lt;BR /&gt;;;D. C. Broad - Demo&lt;BR /&gt;(defun c:test( / ss cyl pos mapd otherend)&lt;BR /&gt; (if (and&lt;BR /&gt; (setq ss (ssget ":S" '((0 . "3DSOLID"))))&lt;BR /&gt; (setq cyl (ssname ss 0))&lt;BR /&gt; (setq cyl (vlax-ename-&amp;gt;vla-object cyl))&lt;BR /&gt; (= (vla-get-objectname cyl)"AcDb3dSolid")&lt;BR /&gt; (= (vla-get-solidtype cyl) "Cylinder")&lt;BR /&gt; )&lt;BR /&gt; (progn&lt;BR /&gt; (setq pos (vlax-get cyl 'position))&lt;BR /&gt; (setq mapd (mapcar '- (vlax-get cyl 'centroid) pos))&lt;BR /&gt; (setq otherend (mapcar '(lambda (a b) (+ a (* 2 b)))&lt;BR /&gt; pos mapd))&lt;BR /&gt; (list&lt;BR /&gt; pos&lt;BR /&gt; otherend)&lt;BR /&gt; )))&lt;/LI-SPOILER&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Aug 2015 21:47:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5785760#M139008</guid>
      <dc:creator>dbroad</dc:creator>
      <dc:date>2015-08-24T21:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: End Points of 3dSolid Cylinder</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5785832#M139009</link>
      <description>&lt;P&gt;Kent - I tried each of the values, but I can't figure out what they mean.&lt;/P&gt;
&lt;P&gt;Here are 10 values, ##=x is angle, posZ=up, negZ=down showing&amp;nbsp;PrincipalDirections values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;0 x, 1.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 1.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 1.0000000000&lt;BR /&gt;&amp;nbsp;45 x, 0.7071067812,-0.7071067812, 0.0000000000, 0.7071067812, 0.7071067812, 0.0000000000, 0.0000000000, 0.0000000000, 1.0000000000&lt;BR /&gt;&amp;nbsp;90 x, 0.0000000000, 0.0000000000, 1.0000000000, 0.0000000000, 1.0000000000, 0.0000000000,-1.0000000000, 0.0000000000, 0.0000000000&lt;BR /&gt;135 x, 0.7071067812,-0.7071067812, 0.0000000000, 0.7071067812, 0.7071067812, 0.0000000000, 0.0000000000, 0.0000000000, 1.0000000000&lt;BR /&gt;180 x, 1.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 1.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 1.0000000000&lt;BR /&gt;225 x, -0.5000000000, 0.5000000000,-0.7071067812, 0.7071067812, 0.7071067812, 0.0000000000, 0.5000000000,-0.5000000000,-0.7071067812&lt;BR /&gt;270 x, 0.0000000000, 0.0000000000, 1.0000000000, 0.0000000000, 1.0000000000, 0.0000000000,-1.0000000000, 0.0000000000, 0.0000000000&lt;BR /&gt;315 x, 0.7071067812,-0.7071067812, 0.0000000000, 0.6969234251, 0.6969234251,-0.1691019787, 0.1195731559, 0.1195731559, 0.9855985597&lt;BR /&gt;pos Z; 1.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 1.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 1.0000000000&lt;BR /&gt;neg Z; 1.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 1.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 1.0000000000&lt;/P&gt;
&lt;P&gt;What I don't get is 0, 180, posZ &amp;amp; negZ are the same, 90 &amp;amp; 270 same, 45 &amp;amp; 135 same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dbroad - I already found the Centroid, but the Postion value is set to nil 'Automation Error. Description was not provided'. I don't know if it matters, but the cylinders are created by CADworx.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Aug 2015 22:44:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5785832#M139009</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-24T22:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: End Points of 3dSolid Cylinder</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5785877#M139010</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Postion value is set to nil 'Automation Error. Description was not provided'. I don't know if it matters, but the cylinders are created by CADworx.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hi mracad,&lt;/P&gt;
&lt;P&gt;as a VlaObject, the Solidtype property is Cylinder, or Extrusion?&lt;/P&gt;
&lt;P&gt;If Cylinder, &lt;SPAN class="hps"&gt;could you&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;please&lt;/SPAN&gt; attach a sample with one or two cylinders.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Mon, 24 Aug 2015 23:16:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5785877#M139010</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-08-24T23:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: End Points of 3dSolid Cylinder</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5785953#M139011</link>
      <description>&lt;P&gt;If it doesn't work for you, it probably means you do not have a cylinder solid. &amp;nbsp;Instead you have cylindrical solids. &amp;nbsp;Nevertheless, it is possible to find what you seek through basic math based on the relationships between volume and mass moments if you are sure that the shapes are cylindrical. &amp;nbsp;See&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/List_of_moments_of_inertia" target="_blank"&gt;https://en.wikipedia.org/wiki/List_of_moments_of_inertia&lt;/A&gt; for the formula of the mass moments of a solid rod. &amp;nbsp;Solve for r and then based on the formula for the volume of a cylinder solve for h.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The principal axes will give you the orientation information. &amp;nbsp;I am sure the eager programers on this site will soon provide a solution for you. &amp;nbsp;Any formula based solution will give erroneous results if the input assumptions are false: &amp;nbsp; GIGO.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2015 00:56:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5785953#M139011</guid>
      <dc:creator>dbroad</dc:creator>
      <dc:date>2015-08-25T00:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: End Points of 3dSolid Cylinder</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5791515#M139012</link>
      <description>&lt;P&gt;Here is a drawing with the 3dsolid cylinders. The cylinders are created by another program and don't have control over how they are created. I have to work with the existing entities.&lt;/P&gt;
&lt;P&gt;Entities in the drawing -&lt;/P&gt;
&lt;P&gt;Layer 1 = 1 cylinder going along z axis in positve Z direction&lt;/P&gt;
&lt;P&gt;Layer 2 = 1 cylinder going &lt;SPAN&gt;along z axis &lt;/SPAN&gt;in negative Z direction&lt;/P&gt;
&lt;P&gt;Layer 3 = 8 cylinders rotated around z axis at 45 degree increments&lt;/P&gt;
&lt;P&gt;Layer 4 = 8 cylnders at 45 degrees from x axis and rotated around&amp;nbsp;&lt;SPAN&gt;z axis at 45 degree increments&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Layer 5&amp;nbsp;= 8 cylnders at -45 degrees from x axis and rotated around&amp;nbsp;&lt;SPAN&gt;z axis at 45 degree increments&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Note - The cylinders represent a pipeline of any length and can be drawn in any direction 3-dimensionally. My goal is to find the end points of each cylinder and cut the cylinders into specific segments. Example - cut a pipe to 8' lengths with leftover at 1 end. This is why I need the endpoints of the center of the cylinders so I can calculate points along the axis of the cylinders. Note - the cylinders will always be straight segments. I don't have to worry about elbows or bends.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2015 14:54:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5791515#M139012</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-27T14:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: End Points of 3dSolid Cylinder</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5791555#M139013</link>
      <description>&lt;P&gt;Or, the maximum pipe length can be set in the CADWorx data catalog and have it cut into pieces&amp;nbsp;from the start.&amp;nbsp; I wouldn't recommend trying to cut pre-2013 CADWorx pipe solids (but it can be done if you are *very* careful with the XDATA), and its impossible post-2013 with the custom objects.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2015 15:04:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5791555#M139013</guid>
      <dc:creator>dgorsman</dc:creator>
      <dc:date>2015-08-27T15:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: End Points of 3dSolid Cylinder</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5791758#M139014</link>
      <description>I am working with post-2013 CADworx drawings that have the CADworx custom objects. I have exploded the custom objects and they have the same values as a 3Dsolid. I am not trying to modify the original objects. I am trying to read each object, then determine the endpoints so I can create new objects of the appropriate length.&lt;BR /&gt;</description>
      <pubDate>Thu, 27 Aug 2015 16:21:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5791758#M139014</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-27T16:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: End Points of 3dSolid Cylinder</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5791761#M139015</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;The cylinders represent a pipeline of any length and can be drawn in any direction 3-dimensionally. My goal is to find the end points of each cylinder and cut the cylinders into specific segments. Example - cut a pipe to 8' lengths with leftover at 1 end. This is why I need the endpoints of the center of the cylinders so I can calculate points along the axis of the cylinders. Note - the cylinders will always be straight segments. I don't have to worry about elbows or bends.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;mracad,&lt;/P&gt;
&lt;P&gt;I don't deal with CADWorx pipes, but if your goal is &lt;EM&gt;'&amp;nbsp;I need the endpoints of the center of the cylinders so I can calculate points along the axis of the cylinders.'&lt;/EM&gt;, we can use the&amp;nbsp;XDATA...&lt;/P&gt;
&lt;P&gt;This &lt;SPAN class="hps"&gt;quick&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;and dirty&lt;/SPAN&gt;&amp;nbsp;'demo' will entmake a center line at selected solids&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:demo (/ en i lst ss)
   (if (setq ss (ssget '((0 . "3DSOLID") (-3 ("CPD1")))))
      (repeat (setq i (sslength ss))
         (setq ent (entget (ssname ss (setq i (1- i))) '("CPD1")))
         (setq lst (vl-remove-if-not '(lambda (x) (= (car x) 1011)) (cdr (car (cdr (assoc -3 ent))))))
         (entmake (list '(0 . "LINE")
                        '(8 . "__Demo")
                        (cons 10 (cdr (nth 0 lst)))
                        (cons 11 (cdr (nth 1 lst)))
                  )
         )
      )
   )
   (princ)
)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps, &lt;BR /&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2015 16:26:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5791761#M139015</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-08-27T16:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: End Points of 3dSolid Cylinder</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5791989#M139016</link>
      <description>&lt;P&gt;This post should have been your first post. &amp;nbsp;It gives enough information to solve your specific needs without conjecture or misunderstanding. &amp;nbsp;It usually helps to attach a sample drawing. &amp;nbsp;In this case, all of your needed data is in the cadworkx xdata, which is attached to each pipe. &amp;nbsp;You can access the xdata yourself by using the expresstools xdlist command. &amp;nbsp;Cadworkx might also have some commands to assist you to do what you need without the kind of customization you are requesting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In any case, Henrique seems to have given you a simple and straightforward strategy to do what you want. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After you ask a question, please keep up with your thread without taking long pauses to reply.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2015 18:32:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5791989#M139016</guid>
      <dc:creator>dbroad</dc:creator>
      <dc:date>2015-08-27T18:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: End Points of 3dSolid Cylinder</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5792195#M139017</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Henrique...Thanks, quick and dirty will help for now.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Dbroad... Not a rant, just my observation...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;This post should have been your first post. &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I don't always now exactly how to express my thoughts well.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I thought - 'Endpoints of a 3dSolid Cylinder' was pretty self explanatory and I didn't know there were different types of solid objects.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;It usually helps to attach a sample drawing.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;I did finally attach a drawing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;In this case, all of your needed data is in the cadworkx xdata, which is attached to each pipe.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;1. I didn't know there was Xdata attached to the objects.&lt;/P&gt;
&lt;P&gt;2. Plus I don't want to rely on the Xdata, since it might change at anytime.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Cadworkx might also have some commands to assist you to do what you need without the kind of customization you are requesting.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;I don't have CADWorx. I am using files from come from another company.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;After you ask a question, please keep up with your thread without taking long pauses to reply.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;I have to work for a living and sometimes I get busy and can't answer quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Still, I am wondering if there is a way to use the following values to determine the endpoints -&lt;/P&gt;
&lt;P&gt;Centroid&lt;/P&gt;
&lt;P&gt;PrincipalDirections&lt;/P&gt;
&lt;P&gt;PrincipalMoments&lt;/P&gt;
&lt;P&gt;MomentOfInertia&lt;/P&gt;
&lt;P&gt;ProductsOfInertia&lt;/P&gt;
&lt;P&gt;RadiiOfGyration&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to follow these threads and quickly became lost -&lt;/P&gt;
&lt;P&gt;&lt;A href="http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/principal-direction-principal-moments/m-p/2451958#M275318" target="_blank"&gt;http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/principal-direction-principal-moments/m-p/2451958#M275318&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/principaldirections-to-angle/m-p/2669235/highlight/true#M288721" target="_blank"&gt;http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/principaldirections-to-angle/m-p/2669235/highlight/true#M288721&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2015 20:20:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5792195#M139017</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-27T20:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: End Points of 3dSolid Cylinder</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5796778#M139018</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;Henrique...Thanks, quick and dirty will help for now.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;... &lt;/EM&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't want to rely on the Xdata, since it might change at anytime.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;...&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Still, I am wondering if there is a way to use the following values to determine the endpoints -&lt;/P&gt;
&lt;P&gt;Centroid&lt;/P&gt;
&lt;P&gt;PrincipalDirections&lt;/P&gt;
&lt;P&gt;PrincipalMoments&lt;/P&gt;
&lt;P&gt;MomentOfInertia&lt;/P&gt;
&lt;P&gt;ProductsOfInertia&lt;/P&gt;
&lt;P&gt;RadiiOfGyration&lt;/P&gt;
&lt;P&gt;&amp;nbsp;...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You're welcome, mracad&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also don't &lt;SPAN class="hps"&gt;like to rely on Xdata on dwg's which were &lt;SPAN class="hps"&gt;not produced by&lt;/SPAN&gt; &lt;SPAN class="hps alt-edited"&gt;me&lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;This is not the answer &lt;SPAN class="hps"&gt;you were&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;waiting.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;&lt;SPAN class="hps"&gt;Determine the endpoints, using the Centroid, PrincipalDirections, ... ,RadiiOfGyration, I do not know either, but using Kailas Dhage's 'ACISdecode', &lt;SPAN class="hps alt-edited"&gt;probably&lt;/SPAN&gt; &lt;SPAN&gt;It can be done&lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;&lt;SPAN class="hps"&gt;Try the attached 'demo'.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;&lt;SPAN class="hps"&gt;Hope this helps, &lt;BR /&gt;Henrique&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2015 23:42:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5796778#M139018</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-08-31T23:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: End Points of 3dSolid Cylinder</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5796959#M139019</link>
      <description>&lt;P&gt;The array of data in the PrincipalDirections property are the X, Y, and Z components of the three vectors describing the principal directions. The XYZ of the First Vector are the 0,1,2 values in the array: Second Vector 3,4,5: Third 6,7,8.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To determine the vector aligned with the ‘length’ of a cylinder, use the vector corresponding to the smallest PrincipalMoments value. If the smallest principal moment value is in the second position, the cylinder is aligned with the Second Vector described above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Of course, this breaks down if the ‘length’ of the cylinder is shorter than its diameter.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2015 06:08:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5796959#M139019</guid>
      <dc:creator>SEANT61</dc:creator>
      <dc:date>2015-09-01T06:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: End Points of 3dSolid Cylinder</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5797192#M139020</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;&lt;P&gt;I am trying to get the end points of a 3dSolid cylinder.&lt;/P&gt;&lt;P&gt;The cylinders can be in any direction 3 dimensionally.&lt;/P&gt;&lt;P&gt;I just don't have a clue how to transform the PrincipalDirections, etc. into a centroid point and then into vectors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;A simple mod of &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/extract-radius-and-height-from-cylinders-amp-boxes/m-p/4341463#M313519" target="_self"&gt;this&lt;/A&gt; post will do the trick.&lt;/P&gt;&lt;P&gt;This lisp will draw lines from end to end&lt;/P&gt;&lt;PRE&gt;; Find cylinder ends
; Stefan M. - 01.09.2015
(defun c:pipes ( / ss i a)
  (if
    (setq ss (ssget '((0 . "3DSOLID"))))
    (repeat (setq i (sslength ss))
      (if
        (setq a (pipe_ends (ssname ss (setq i (1- i)))))
        (entmake (list '(0 . "LINE") (cons 10 (car a)) (cons 11 (cadr a))))
      )
    )
  )
  (princ)
  )

(defun pipe_ends (e / i v r l c d)
  (setq e (vlax-ename-&amp;gt;vla-object e)
        v (vlax-get e 'Volume)
        i ((lambda (x)
             (if
               (equal (car x) (cadr x) (* 0.001 (car x)))
               (list (caddr x) (car x) 3)
               (if
                 (equal (car x) (caddr x) (* 0.001 (car x)))
                 (list (cadr x) (car x) 2)
                 (if
                   (equal (cadr x) (caddr x) (* 0.001 (cadr x)))
                   (list (car x) (cadr x) 1)
                 )
               )
             )
           )
           (vlax-get e 'PrincipalMoments)
          )
        )
  (if i
    (progn
      (setq r (sqrt (/ (* 2.0 (car i)) v))
            l (/ v (* pi r r)))
      (if
        (equal (/ (cadr i) (/ (* v (+ (* 3.0 r r) (* l l))) 12.0)) 1.0 1e-5)
        (progn
          (setq c (vlax-get e 'Centroid)
                d (vlax-get e 'PrincipalDirections)
                d (cond
                    ((= (caddr i) 1) (list (nth 0 d) (nth 1 d) (nth 2 d)))
                    ((= (caddr i) 2) (list (nth 3 d) (nth 4 d) (nth 5 d)))
                    ((= (caddr i) 3) (list (nth 6 d) (nth 7 d) (nth 8 d)))
                    )
                )
          (list
            (mapcar '(lambda (a b) (- a (* b l 0.5))) c d)
            (mapcar '(lambda (a b) (+ a (* b l 0.5))) c d)
          )
        )
      )
    )
  )
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2015 09:28:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5797192#M139020</guid>
      <dc:creator>phanaem</dc:creator>
      <dc:date>2015-09-01T09:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: End Points of 3dSolid Cylinder</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5797207#M139021</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/314908"&gt;@phanaem&lt;/a&gt; wrote:&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;A&amp;nbsp;simple mod of &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/extract-radius-and-height-from-cylinders-amp-boxes/m-p/4341463#M313519" target="_self"&gt;this&lt;/A&gt; post will do the trick.&lt;/P&gt;
&lt;P&gt;This lisp will draw lines from end to end&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Nicely done.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2015 09:37:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5797207#M139021</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-09-01T09:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: End Points of 3dSolid Cylinder</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5797254#M139022</link>
      <description>&lt;P&gt;How about this 3dSolid Cylinder?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2015 10:26:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5797254#M139022</guid>
      <dc:creator>SEANT61</dc:creator>
      <dc:date>2015-09-01T10:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: End Points of 3dSolid Cylinder</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5797284#M139023</link>
      <description>OP says "pipe", so it is hard to believe this will be the case... My lisp will ignore elliptical cylinders or any other 3dsolid which is not a proper cylinder.&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Sep 2015 10:54:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5797284#M139023</guid>
      <dc:creator>phanaem</dc:creator>
      <dc:date>2015-09-01T10:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: End Points of 3dSolid Cylinder</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5797347#M139024</link>
      <description>&lt;P&gt;Hat off to Stefan, but it won't work with special cases cylinders... So Sean, have you tested it with h=r*(sqrt 3.0) ... This is the special case and not h=2r (diameter)... You can check it with my dwg and also with massprop command... Look into final principal moments about centroid (I,J,K)...&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2015 11:54:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5797347#M139024</guid>
      <dc:creator>marko_ribar</dc:creator>
      <dc:date>2015-09-01T11:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: End Points of 3dSolid Cylinder</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5797541#M139025</link>
      <description>&lt;P&gt;Maybe it looks cumbersome and slow, but it works for all cylinders and only cylinder 3DSOLIDS... So I would give myself kudo for this one :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;; Find cylinder ends&lt;BR /&gt;; Marko R. - 01.09.2015&lt;BR /&gt;(defun c:pipes ( / *adoc* *error* chkcyl qaf ss i cyl el s p1 p2 pll )&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; (vl-load-com)&lt;BR /&gt;&amp;nbsp; (setq *adoc* (vla-get-activedocument (vlax-get-acad-object)))&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; (defun *error* ( msg )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (if qaf (setvar 'qaflags qaf))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (vla-endundomark *adoc*)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (if msg (prompt msg))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (princ)&lt;BR /&gt;&amp;nbsp; )&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; (defun chkcyl ( ent / el s chk )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (vla-startundomark *adoc*)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq el (entlast))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (command "_.EXPLODE" ent)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (while (&amp;lt; 0 (getvar 'cmdactive)) (command ""))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq s (ssget "_P"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (while (not (eq el (entlast)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (command "_.EXPLODE" s)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (while (&amp;lt; 0 (getvar 'cmdactive)) (command ""))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq el (entlast))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq s (ssget "_P"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (if (and s (= (sslength s) 4) (eq (cdr (assoc 0 (entget (ssname s 0)))) "CIRCLE") (eq (cdr (assoc 0 (entget (ssname s 1)))) "CIRCLE") (eq (cdr (assoc 0 (entget (ssname s 2)))) "CIRCLE") (eq (cdr (assoc 0 (entget (ssname s 3)))) "CIRCLE"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq chk t)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq chk nil)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (command "_.UNDO" "_B")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; chk&lt;BR /&gt;&amp;nbsp; )&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; (vla-startundomark *adoc*)&lt;BR /&gt;&amp;nbsp; (setq qaf (getvar 'qaflags))&lt;BR /&gt;&amp;nbsp; (setvar 'qaflags 1)&lt;BR /&gt;&amp;nbsp; (prompt "\nSelect cylinder 3DSOLID entities...")&lt;BR /&gt;&amp;nbsp; (setq ss (ssget '((0 . "3DSOLID"))))&lt;BR /&gt;&amp;nbsp; (while (or (not ss) (and ss (not (apply 'and (mapcar 'chkcyl (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))))))))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (prompt "\nEmpty sel.set or one or more selected entities don't belong to cylinder 3dsolid entities... Please select cylinder 3DSOLID entities again...")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq ss (ssget '((0 . "3DSOLID"))))&lt;BR /&gt;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp; (repeat (setq i (sslength ss))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq cyl (ssname ss (setq i (1- i))))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq el (entlast))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (command "_.EXPLODE" cyl)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (while (&amp;lt; 0 (getvar 'cmdactive)) (command ""))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq s (ssget "_P"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (while (not (eq el (entlast)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (command "_.EXPLODE" s)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (while (&amp;lt; 0 (getvar 'cmdactive)) (command ""))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq el (entlast))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq s (ssget "_P"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (if (and (eq (cdr (assoc 0 (entget (ssname s 0)))) "CIRCLE") (eq (cdr (assoc 0 (entget (ssname s 1)))) "CIRCLE"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (progn&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq p1 (trans (cdr (assoc 10 (entget (ssname s 0)))) (ssname s 0) 0) p2 (trans (cdr (assoc 10 (entget (ssname s 1)))) (ssname s 1) 0))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq pll (cons (list p1 p2) pll))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (command "_.UNDO" "_B")&lt;BR /&gt;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp; (foreach pl pll&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (entmake (list '(0 . "LINE") (cons 10 (car pl)) (cons 11 (cadr pl))))&lt;BR /&gt;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp; (*error* nil)&lt;BR /&gt;)&lt;/PRE&gt;&lt;P&gt;Regards, M.R.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2015 13:26:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/end-points-of-3dsolid-cylinder/m-p/5797541#M139025</guid>
      <dc:creator>marko_ribar</dc:creator>
      <dc:date>2015-09-01T13:26:43Z</dc:date>
    </item>
  </channel>
</rss>

