<?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: Delete vertexes on 3D polylines with 0 elevation in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/9062007#M83600</link>
    <description>&lt;P&gt;Thank you for your work.&lt;/P&gt;&lt;P&gt;I try your lisp and you are right for last if the elevation is the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank again for your help.&lt;/P&gt;</description>
    <pubDate>Wed, 02 Oct 2019 12:01:37 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-10-02T12:01:37Z</dc:date>
    <item>
      <title>Delete vertexes on 3D polylines with 0 elevation</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/9056723#M83590</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have just start with the lisp edition. So I'm not very good editor.&lt;/P&gt;&lt;P&gt;I work actually on the project with many 3D polylines. On this polylines I have many vertexes with 0 elevation.&amp;nbsp; My question have you a lisp&amp;nbsp; to delete all vertexes with 0 in elevation. Or if we have a fonction autocad to make the same thing ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Many thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 12:07:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/9056723#M83590</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-30T12:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: Delete vertexes on 3D polylines with 0 elevation</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/9056759#M83591</link>
      <description>&lt;P&gt;Can you post a sample drawing with one or two of them?&amp;nbsp; I'm wondering about the kind of geometry that would not be "ruined" in some way by removing vertices just for their elevation, rather than for [as an example] being too many too close together.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 12:28:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/9056759#M83591</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2019-09-30T12:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: Delete vertexes on 3D polylines with 0 elevation</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/9056772#M83592</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;For this project the good geometry for polylines is when the vertexes have an elevation. The vertexes with 0 in elevation was not good.&amp;nbsp;(They were generated by the customer, for another project.&lt;/P&gt;&lt;P&gt;I have attached an example.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 12:41:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/9056772#M83592</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-30T12:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Delete vertexes on 3D polylines with 0 elevation</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/9056837#M83593</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp; hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i view your file in 3d and it looks like 50% of the points are in zero elevation, removing all these point will change the polyline geometry in 3d dramatically - is this what you want?!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;moshe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 13:04:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/9056837#M83593</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2019-09-30T13:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: Delete vertexes on 3D polylines with 0 elevation</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/9056877#M83594</link>
      <description>&lt;P&gt;Try this [lightly tested]:&lt;/P&gt;
&lt;PRE&gt;(vl-load-com)&lt;BR /&gt;(defun C:NoZ0 (/ plobj coordslist noZ0list)
  (setq plobj (vlax-ename-&amp;gt;vla-object (car (entsel "\n3DPolyline to remove Z=0 vertices from: "))))
  (setq coordslist (vlax-get plobj 'coordinates))
  (while coordslist
    (if (/= (caddr coordslist) 0.0); this vertex at other-than-0 elevation?
      (setq noZ0list (append noZ0list (list (car coordslist) (cadr coordslist) (caddr coordslist))))
        ; then -- put it into fixed list
    ); if
    (setq coordslist (cdddr coordslist)); remove that vertex from list
  ); while
  (vlax-put plobj 'Coordinates noZ0list); impose fixed coordinates list
  (princ)
); defun&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Sep 2019 13:32:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/9056877#M83594</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2019-09-30T13:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: Delete vertexes on 3D polylines with 0 elevation</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/9056916#M83595</link>
      <description>&lt;P&gt;Many thanks, it works.&lt;/P&gt;&lt;P&gt;Thanks to you I will save a lot of time&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 13:33:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/9056916#M83595</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-30T13:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Delete vertexes on 3D polylines with 0 elevation</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/9057604#M83596</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Many thanks, it works.&lt;/P&gt;
&lt;P&gt;Thanks to you I will save a lot of time&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You're welcome.&amp;nbsp; When I first thought about how to go about it, I expected it would take a lot more lines of code to do it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It does occur to me that, since your example 3DPolylines extend both above and below the Z=0 level, there's a possibility that a vertex you would want kept will be removed.&amp;nbsp; It would need to land at exactly 0.0000, which at first I didn't think would be very likely very often [the first one I looked at went from about 0.0330 to -0.0430 as it crossed that level].&amp;nbsp; But I notice this over-straightening in the results, where there must have been a series of "correct" vertices that were at Z=0:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="NoZ0.PNG" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/682818i84760B1FFEADBE62/image-size/medium?v=v2&amp;amp;px=400" role="button" title="NoZ0.PNG" alt="NoZ0.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I'm not sure how to think about preventing that, since it's hard to picture how the routine could determine which are the desirable ones at Z=0 and which are the undesirable ones.&amp;nbsp; In some places there are &lt;EM&gt;two&lt;/EM&gt;&amp;nbsp; extra vertices at Z=0 between each adjacent pair at elevations to keep, but in other places only &lt;EM&gt;one&lt;/EM&gt;, so it couldn't be just a matter of something like checking every other one.&amp;nbsp; Do you have any definable criteria?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 17:39:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/9057604#M83596</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2019-09-30T17:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: Delete vertexes on 3D polylines with 0 elevation</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/9058847#M83597</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I haven't definable criteria the evalation goes from 35m to -20m.&lt;/P&gt;&lt;P&gt;You are right some "good" vertexes can be deleted beacause they are 0 in elevation. I forgot this when&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe I have the solution for get around the problem. I can ask the customers to change the elevation 0 to 100 so the elevation of wrong vertexes are out of the project elevation. If it possible.&lt;/P&gt;&lt;P&gt;But for the lisp is it to possible to choose which elevation we can delete ? not only 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2019 07:33:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/9058847#M83597</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-01T07:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Delete vertexes on 3D polylines with 0 elevation</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/9059516#M83598</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;.... I can ask the customers to change the elevation 0 to 100 so the elevation of wrong vertexes are out of the project elevation. ....&amp;nbsp;&lt;/SPAN&gt;is it to possible to choose which elevation we can delete ? not only 0&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, something like this [untested]:&lt;/P&gt;
&lt;PRE&gt;(vl-load-com)
(defun C:&lt;FONT color="#000000"&gt;&lt;STRONG&gt;NoZU&lt;/STRONG&gt;&lt;/FONT&gt; (/ UZ plobj coordslist noZUlist)
  (setq
    UZ (getreal "\nUser-Z Coordinate of vertices to be removed: ")
    plobj (vlax-ename-&amp;gt;vla-object (car (entsel "\n3DPolyline to remove User-Z vertices from: ")))
    coordslist (vlax-get plobj 'coordinates)
  ); setq
  (while coordslist
    (if (/= (caddr coordslist) UZ); this vertex at other-than-User-Z elevation?
      (setq noZUlist (append noZUlist (list (car coordslist) (cadr coordslist) (caddr coordslist))))
        ; then -- put it into fixed list
    ); if
    (setq coordslist (cdddr coordslist)); remove that vertex from list
  ); while
  (vlax-put plobj 'Coordinates noZUlist); impose fixed coordinates list
  (princ)
); defun&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It could also be made to ask for the User to pick a point [one of the vertices at that elevation] to set that, rather than type in a number.&amp;nbsp; And other improvements are possible -- verify that you picked something, and the right kind of thing, remember the chosen elevation and offer it as default on subsequent use, Undo begin-end wrapping, error handling, multiple path selection at one run, etc.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2019 12:47:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/9059516#M83598</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2019-10-01T12:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: Delete vertexes on 3D polylines with 0 elevation</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/9059989#M83599</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;... for the lisp is it to possible to choose which elevation we can delete ? not only 0&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or, if you always want the &lt;EM&gt;same&lt;/EM&gt;&amp;nbsp; elevation used [i.e. if it's viable to ask the source to always use a particular elevation that you know will always be outside the vertical range of the end results], you can simply replace the 0.0 in the code with that particular elevation.&amp;nbsp; Then you won't need to answer a prompt for the elevation every time you use it.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2019 15:05:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/9059989#M83599</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2019-10-01T15:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: Delete vertexes on 3D polylines with 0 elevation</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/9062007#M83600</link>
      <description>&lt;P&gt;Thank you for your work.&lt;/P&gt;&lt;P&gt;I try your lisp and you are right for last if the elevation is the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank again for your help.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 12:01:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/9062007#M83600</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-02T12:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Delete vertexes on 3D polylines with 0 elevation</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/9062979#M83601</link>
      <description>&lt;P&gt;Hello Kent&lt;BR /&gt;&lt;BR /&gt;1) Thks for all your beautiful routines !&lt;BR /&gt;&lt;BR /&gt;2) Please may I ask your for a "better" version ?&lt;BR /&gt;&lt;BR /&gt;3) 2 questions :&lt;BR /&gt;Altitude less or equal than ? Default = 0&lt;BR /&gt;Altitude greater or equal than ? Default = 1000&lt;BR /&gt;&lt;BR /&gt;So the routine will keep 3D vertex only between !&lt;BR /&gt;&lt;BR /&gt;Of course, il will be possible to select N 3DPlines ?&lt;BR /&gt;&lt;BR /&gt;Do your see what I mean ?&lt;BR /&gt;&lt;BR /&gt;Thanks in avance, Regards, Patrice &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 17:40:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/9062979#M83601</guid>
      <dc:creator>braudpat</dc:creator>
      <dc:date>2019-10-02T17:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: Delete vertexes on 3D polylines with 0 elevation</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/13112511#M83602</link>
      <description>&lt;P&gt;This is perfect and works fine! but here I have a little bit modified it. Previously the process was one by one but using this modification you can do multiple selection or windows selection:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(vl-load-com)
(defun C:NoZ0 (/ ss index plobj coordslist noZ0list objType)
  (setq ss (ssget)) ; Select any objects
  
  (if ss ; Check if anything was selected
    (progn
      (setq index 0) ; Initialize index for selection set
      
      (while (&amp;lt; index (sslength ss))
        (setq plobj (vlax-ename-&amp;gt;vla-object (ssname ss index)))
        (setq objType (vla-get-ObjectName plobj))
        
        (if (eq objType "AcDb3dPolyline") ; Check if the object is a 3D polyline
          (progn
            (setq coordslist (vlax-get plobj 'coordinates))
            (setq noZ0list nil) ; Reset the list for each polyline
            
            (while coordslist
              (if (/= (caddr coordslist) 0.0) ; Check if Z-coordinate is not 0
                (setq noZ0list (append noZ0list (list (car coordslist) (cadr coordslist) (caddr coordslist))))
              )
              (setq coordslist (cdddr coordslist)) ; Move to the next vertex
            )
            
            (vlax-put plobj 'Coordinates noZ0list) ; Update coordinates of the polyline
          )
        )
        
        (setq index (1+ index)) ; Move to the next object in the selection set
      )
      
      (princ "\nZ=0 vertices removed from selected 3D polylines.")
    )
    (princ "\nNo objects selected.")
  )
  (princ)
)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 28 Oct 2024 10:11:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-vertexes-on-3d-polylines-with-0-elevation/m-p/13112511#M83602</guid>
      <dc:creator>kamalgaramja556</dc:creator>
      <dc:date>2024-10-28T10:11:03Z</dc:date>
    </item>
  </channel>
</rss>

