<?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: Need lisp for polyline in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/10602683#M95252</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;.... Would it be complicate to install a short request in the AutoCAD commando line for inserting a individual high for the steps? ....&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That is probably not complicated, but I'm not quite sure exactly what you mean by it.&amp;nbsp; Can you post an image or sample drawing pointing with notes indicating what you're starting with and the kind of result you want?&lt;/P&gt;</description>
    <pubDate>Mon, 06 Sep 2021 11:33:05 GMT</pubDate>
    <dc:creator>Kent1Cooper</dc:creator>
    <dc:date>2021-09-06T11:33:05Z</dc:date>
    <item>
      <title>Need lisp for polyline</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/8478097#M95238</link>
      <description>&lt;P&gt;I am in a need for a lisp that can draw a specif&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot (4).png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/583146iE98B7E6F5C58BEE6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot (4).png" alt="Screenshot (4).png" /&gt;&lt;/span&gt;ic polyline like shown Picture.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 12:56:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/8478097#M95238</guid>
      <dc:creator>kajanthangavel</dc:creator>
      <dc:date>2018-12-19T12:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Need lisp for polyline</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/8478344#M95239</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6662555"&gt;@kajanthangavel&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Will your new (white) polyline ever step down?&lt;/P&gt;
&lt;P&gt;Is the change in Y always 0.15 units?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;~DD&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 14:32:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/8478344#M95239</guid>
      <dc:creator>CodeDing</dc:creator>
      <dc:date>2018-12-19T14:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need lisp for polyline</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/8478669#M95240</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6662555"&gt;@kajanthangavel&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That was a fun bit of a challenge for me. It may not be ideal code, but it works and it's pretty quick.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;~DD&lt;/P&gt;
&lt;PRE&gt;(defun c:STEP ( / ptList lineList ptNow ptNext ptTmp ptInt e x isNeg)
;Created by CodeDing 12/19/18
(if (eq (cdr (assoc 0 (entget (setq e (car (entsel "\nSelect Polyline: ")))))) "LWPOLYLINE")
	(foreach x (entget e) (if (= 10 (car x)) (setq ptList (cons (list (cadr x) (caddr x)) ptList))))
  	(progn (prompt "\nPolyline not selected.") (exit)))
(command "_.ZOOM" "o" e "")

(setq ptList (vl-sort ptList (function (lambda ( a b ) (&amp;lt; (car a) (car b))))))
(setq ptNow (nth 0 ptList))
(setq ptTmp ptNow)
(setq lineList (cons ptNow lineList))

(while (and (&amp;gt; (length ptList) 1) (not isNeg))
  	(setq ptNext (nth 1 ptList))
	(while (&amp;gt;= (- (cadr ptNext) (cadr ptTmp)) 0.15)
		(setq ptInt (inters ptNow ptNext (list (car ptTmp) (+ 0.15 (cadr ptTmp))) (list (+ 1.0 (car ptTmp)) (+ 0.15 (cadr ptTmp))) nil))
	    	(setq lineList (reverse (cons (list (car ptInt) (cadr ptTmp)) (reverse lineList))))
	    	(setq lineList (reverse (cons ptInt (reverse lineList))))
		(setq ptTmp ptInt)
	);while
  	(if (&amp;gt; 0 (- (cadr ptNext) (cadr ptNow)))
	  (progn
		(setq isNeg t)
	    	(setq ptInt (inters ptNow ptNext ptInt (list (+ 1.0 (car ptInt)) (cadr ptInt)) nil))
	    	(setq lineList (reverse (cons ptInt (reverse lineList))))
	  );progn
	  	(setq ptNow ptNext ptList (vl-remove (nth 0 ptList) ptList))
	);if
);while
(if (listp lineList)
  (LWPoly lineList 0)
  (prompt "\nNo line Generated.")
);if
(prompt "\nSTEP Complete.")
(princ)
);defun

(defun LWPoly (lst cls)
;Originally created by Lee Mac
 (entmakex (append (list (cons 0 "LWPOLYLINE")
                         (cons 100 "AcDbEntity")
                         (cons 100 "AcDbPolyline")
                         (cons 90 (length lst))
                         (cons 70 cls))
                   (mapcar (function (lambda (p) (cons 10 p))) lst))))&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Dec 2018 16:36:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/8478669#M95240</guid>
      <dc:creator>CodeDing</dc:creator>
      <dc:date>2018-12-19T16:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: Need lisp for polyline</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/8479654#M95241</link>
      <description>&lt;P&gt;Forgot to include turning off OSNAPs...&lt;/P&gt;
&lt;PRE&gt;(defun c:STEP ( / osm ptList lineList ptNow ptNext ptTmp ptInt e x isNeg)
;Created by CodeDing 12/19/18
(if (eq (cdr (assoc 0 (entget (setq e (car (entsel "\nSelect Polyline: ")))))) "LWPOLYLINE")
	(foreach x (entget e) (if (= 10 (car x)) (setq ptList (cons (list (cadr x) (caddr x)) ptList))))
  	(progn (prompt "\nPolyline not selected.") (exit)))
(command "_.ZOOM" "o" e "")

(setq osm (getvar 'OSMODE))
(setvar 'OSMODE 0)
(setq ptList (vl-sort ptList (function (lambda ( a b ) (&amp;lt; (car a) (car b))))))
(setq ptNow (nth 0 ptList))
(setq ptTmp ptNow)
(setq lineList (cons ptNow lineList))

(while (and (&amp;gt; (length ptList) 1) (not isNeg))
  	(setq ptNext (nth 1 ptList))
	(while (&amp;gt;= (- (cadr ptNext) (cadr ptTmp)) 0.15)
		(setq ptInt (inters ptNow ptNext (list (car ptTmp) (+ 0.15 (cadr ptTmp))) (list (+ 1.0 (car ptTmp)) (+ 0.15 (cadr ptTmp))) nil))
	    	(setq lineList (reverse (cons (list (car ptInt) (cadr ptTmp)) (reverse lineList))))
	    	(setq lineList (reverse (cons ptInt (reverse lineList))))
		(setq ptTmp ptInt)
	);while
  	(if (&amp;gt; 0 (- (cadr ptNext) (cadr ptNow)))
	  (progn
		(setq isNeg t)
	    	(setq ptInt (inters ptNow ptNext ptInt (list (+ 1.0 (car ptInt)) (cadr ptInt)) nil))
	    	(setq lineList (reverse (cons ptInt (reverse lineList))))
	  );progn
	  	(setq ptNow ptNext ptList (vl-remove (nth 0 ptList) ptList))
	);if
);while
(if (listp lineList)
  (LWPoly lineList 0)
  (prompt "\nNo line Generated.")
);if
(setvar 'OSMODE osm)
(prompt "\nSTEP Complete.")
(princ)
);defun

(defun LWPoly (lst cls)
;Originally created by Lee Mac
 (entmakex (append (list (cons 0 "LWPOLYLINE")
                         (cons 100 "AcDbEntity")
                         (cons 100 "AcDbPolyline")
                         (cons 90 (length lst))
                         (cons 70 cls))
                   (mapcar (function (lambda (p) (cons 10 p))) lst))))&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Dec 2018 22:48:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/8479654#M95241</guid>
      <dc:creator>CodeDing</dc:creator>
      <dc:date>2018-12-19T22:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: Need lisp for polyline</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/8479936#M95242</link>
      <description>&lt;P&gt;I am Working in a Road construction company. That "150mm" thickness soil can be compacted well. so i need to cut like that at the road.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2018 03:03:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/8479936#M95242</guid>
      <dc:creator>kajanthangavel</dc:creator>
      <dc:date>2018-12-20T03:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Need lisp for polyline</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/8479942#M95243</link>
      <description>&lt;P&gt;Thank you to for reply.&lt;/P&gt;
&lt;P&gt;But, this lisp working only single straight polyline. but i need&amp;nbsp; to apply many vertex polyline..&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2018 03:13:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/8479942#M95243</guid>
      <dc:creator>kajanthangavel</dc:creator>
      <dc:date>2018-12-20T03:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need lisp for polyline</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/8480611#M95244</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6662555"&gt;@kajanthangavel&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That lisp definitely works on multi-vertex polylines.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 493px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/583520i8902DD09B6BACE5B/image-dimensions/493x224?v=v2" width="493" height="224" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;...however, it will not effectively work on polylines with arcs...&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 495px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/583522iA406CCEBDF452B35/image-dimensions/495x480?v=v2" width="495" height="480" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;~DD&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2018 12:27:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/8480611#M95244</guid>
      <dc:creator>CodeDing</dc:creator>
      <dc:date>2018-12-20T12:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: Need lisp for polyline</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/8480983#M95245</link>
      <description>&lt;P&gt;I would like to reiterate &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5680873"&gt;@CodeDing&lt;/a&gt;'s first question in Message 2, which the routine does not handle [left side of image below].&amp;nbsp; And would the Polyline ever slope the other way [right side]?&amp;nbsp; The routine also doesn't work in that situation.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="STEP.PNG" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/583632iA734EA584523F93D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="STEP.PNG" alt="STEP.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Even if it generally slopes upward from left to right, if it goes downward first before going predominantly upward, the same error occurs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;These&amp;nbsp;don't matter if you never have such situations, but that doesn't seem likely in the real world.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2018 14:09:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/8480983#M95245</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2018-12-20T14:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: Need lisp for polyline</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/8481258#M95246</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;P&gt;I would like to reiterate &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5680873"&gt;@CodeDing&lt;/a&gt;'s first question in Message 2, which the routine does not handle ....&amp;nbsp; And would the Polyline ever slope the other way [right side]?&amp;nbsp; The routine also doesn't work in that situation. ....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;(defun C:STEP-15 (/ *error* doc svnames svvals ss n plobj LL xl xlobj intc pts)
;; Kent Cooper 12/20/18
  (defun *error* (errmsg)
    (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break"))
      (princ (strcat "\nError: " errmsg))
    ); if
    (mapcar 'setvar svnames svvals); reset System Variables
    (vla-endundomark doc)
    (princ)
  ); defun - *error*
  (vla-startundomark (setq doc (vla-get-activedocument (vlax-get-acad-object))))
  (setq
    svnames '(osmode cmdecho blipmode plinewid)
    svvals (mapcar 'getvar svnames)
  ); setq
  (prompt "\nTo draw 0.15-height under-side steps along Polyline(s),")
  (if (setq ss (ssget '((0 . "*POLYLINE"))))
    (progn ; then
      (mapcar 'setvar svnames '(0 0 0 0))&lt;BR /&gt;        ; turn off Osnap, command echoing, blips; set Pline width to 0
      (repeat (setq n (sslength ss))
        (setq
          pts nil ; [reset from previous]
          plobj (vlax-ename-&amp;gt;vla-object (ssname ss (setq n (1- n))))
        ); setq
        (vla-getboundingbox plobj 'minpt 'maxpt)
        (setq LL (vlax-safearray-&amp;gt;list minpt)); setq
        (command "_.xline" "_hor" LL "")
        (setq xl (entlast) xlobj (vlax-ename-&amp;gt;vla-object xl))
        (repeat (1+ (fix (/ (- (cadr (vlax-safearray-&amp;gt;list maxpt)) (cadr LL)) 0.15)))
          (setq intc (vlax-invoke plobj 'IntersectWith xlobj acExtendNone))
          (while intc
            (setq
              pts (cons (list (car intc) (cadr intc) (caddr intc)) pts)
              intc (cdddr intc); to next [if any]
            ); setq
          ); while
          (command "_.move" xl "" "0,0.15" ""); next level upward
        ); repeat
        (entdel xl); remove level-stepping Xline
        (if (&amp;gt; (length pts) 1); i.e. Polyline had enough vertical extent for &amp;gt;1 levels
          (progn ; then
            (setq pts (vl-sort pts '(lambda (a b) (&amp;lt; (car a) (car b))))); left-to-right order
            (command "_.pline" (car pts)); start at left-most point
            (while (&amp;gt; (length pts) 1); still at least 2 points left
              (command
                (if (&amp;lt; (cadar pts) (cadadr pts)); current point lower than next point?
                  (list (caadr pts) (cadar pts)); then -- X of next point, Y of current point
                  (list (caar pts) (cadadr pts)); else -- X of current point, Y of next point
                ); if
                (cadr pts); then next point
              ); command
              (setq pts (cdr pts)); remove current point
            ); while
            (command (car pts) ""); finish Polyline
          ); progn
        ); if
      ); repeat [each Polyline]
    ); progn
    (prompt "\nNo Polyline(s) selected."); else
  ); if [selection]
  (mapcar 'setvar svnames svvals); reset System Variables
  (vla-endundomark doc)
  (princ)
); defun -- C:STEP-15&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It works with Polylines containing arc segments:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="STEP1.PNG" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/583654i7D9B243475ACD119/image-size/medium?v=v2&amp;amp;px=400" role="button" title="STEP1.PNG" alt="STEP1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;and with ones that slope in either direction, or that &lt;EM&gt;reverse&lt;/EM&gt;&amp;nbsp; vertical direction:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="STEP2.PNG" style="width: 267px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/583655i0F02267D80F1761E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="STEP2.PNG" alt="STEP2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;and note there that it always touches, and bases its 0.15-height stepping from,&amp;nbsp;the &lt;EM&gt;lowest point&lt;/EM&gt;&amp;nbsp; in the Polyline's vertical extent, which in the case above&amp;nbsp;is the &lt;EM&gt;right&lt;/EM&gt;&amp;nbsp; end.&amp;nbsp; If a Polyline goes downward &lt;EM&gt;and then back upward again&lt;/EM&gt;,&amp;nbsp;but where that dip is &lt;EM&gt;not&lt;/EM&gt;&amp;nbsp; the lowest point [here, the "path" extends lower outside the image] it can result in a stepped Polyline that is in part &lt;EM&gt;above&lt;/EM&gt;&amp;nbsp; the "path" Polyline:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="STEP3.PNG" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/583656i4B1DE952FE47ADE5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="STEP3.PNG" alt="STEP3.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;though it does have vertices on it.&amp;nbsp;&amp;nbsp;I suppose it might&amp;nbsp;be possible to&amp;nbsp;revise it to step downward another level across that space, if appropriate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can select more than one Polyline in or parallel to the current drawing plane&amp;nbsp;[of any variety, but if 3D, they must be planar], and it will do all of them at once.&amp;nbsp; It draws the stepped one on the current Layer, at constant zero width regardless of the current PLINEWID setting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It could be adjusted to ask for a stepping height, rather than have the 0.15 built in, and/or could be made to work with planar Polylines &lt;EM&gt;not&lt;/EM&gt;&amp;nbsp; parallel to&amp;nbsp;the current XY plane, and/or with other "path" object types [Lines, Splines, Arcs, etc.].&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2018 15:58:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/8481258#M95246</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2018-12-20T15:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: Need lisp for polyline</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/8482654#M95247</link>
      <description>&lt;P&gt;Thank you so much &lt;SPAN class="UserName lia-user-name lia-user-rank-Employee lia-component-message-view-widget-author-username"&gt;&lt;A class="lia-link-navigation lia-page-link lia-user-name-link" href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526" target="_self"&gt;&lt;SPAN class="login-bold"&gt;Kent1Cooper and &lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;A href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5680873" target="_blank"&gt;CodeDing also.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="UserName lia-user-name lia-user-rank-Employee lia-component-message-view-widget-author-username"&gt;&lt;SPAN class="login-bold"&gt;I found Good lisp. It save my time.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Dec 2018 05:57:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/8482654#M95247</guid>
      <dc:creator>kajanthangavel</dc:creator>
      <dc:date>2018-12-21T05:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need lisp for polyline</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/10600653#M95248</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt; , &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6662555"&gt;@kajanthangavel&lt;/a&gt; , &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5680873"&gt;@CodeDing&lt;/a&gt; !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thats such a great lisp - awesome work!!!! Would it be possible to start the steps instead of the lowest point of the polyline, from the highest? I tried to flip the coordiante system around the z-axis (180°) - but my simple (stupid) idea didn`t work:-).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;best wishes&lt;/P&gt;&lt;P&gt;Stephan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Sep 2021 10:52:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/10600653#M95248</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-05T10:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need lisp for polyline</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/10601558#M95249</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;.... Would it be possible to start the steps instead of the lowest point of the polyline, from the highest? ....&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Try this [&lt;EM&gt;minimally&lt;/EM&gt; tested]:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(defun C:STEP-15 (/ *error* doc svnames svvals ss n plobj UR xl xlobj intc pts)
;; Kent Cooper 12/20/18
  (defun *error* (errmsg)
    (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break"))
      (princ (strcat "\nError: " errmsg))
    ); if
    (mapcar 'setvar svnames svvals); reset System Variables
    (vla-endundomark doc)
    (princ)
  ); defun - *error*
  (vla-startundomark (setq doc (vla-get-activedocument (vlax-get-acad-object))))
  (setq
    svnames '(osmode cmdecho blipmode plinewid)
    svvals (mapcar 'getvar svnames)
  ); setq
  (prompt "\nTo draw 0.15-height under-side steps along Polyline(s),")
  (if (setq ss (ssget '((0 . "*POLYLINE"))))
    (progn ; then
      (mapcar 'setvar svnames '(0 0 0 0))
        ; turn off Osnap, command echoing, blips; set Pline width to 0
      (repeat (setq n (sslength ss))
        (setq
          pts nil ; [reset from previous]
          plobj (vlax-ename-&amp;gt;vla-object (ssname ss (setq n (1- n))))
        ); setq
        (vla-getboundingbox plobj 'minpt 'maxpt)
        (setq UR (vlax-safearray-&amp;gt;list maxpt)); setq
        (command "_.xline" "_hor" UR "")
        (setq xl (entlast) xlobj (vlax-ename-&amp;gt;vla-object xl))
        (repeat (1+ (fix (/ (- (cadr UR) (cadr (vlax-safearray-&amp;gt;list minpt))) 0.15)))
          (setq intc (vlax-invoke plobj 'IntersectWith xlobj acExtendNone))
          (while intc
            (setq
              pts (cons (list (car intc) (cadr intc) (caddr intc)) pts)
              intc (cdddr intc); to next [if any]
            ); setq
          ); while
          (command "_.move" xl "" "0,-0.15" ""); next level downward
        ); repeat
        (entdel xl); remove level-stepping Xline
        (if (&amp;gt; (length pts) 1); i.e. Polyline had enough vertical extent for &amp;gt;1 levels
          (progn ; then
            (setq pts (vl-sort pts '(lambda (a b) (&amp;lt; (car a) (car b))))); left-to-right order
            (command "_.pline" (car pts)); start at left-most point
            (while (&amp;gt; (length pts) 1); still at least 2 points left
              (command
                (if (&amp;lt; (cadar pts) (cadadr pts)); current point lower than next point?
                  (list (caadr pts) (cadar pts)); then -- X of next point, Y of current point
                  (list (caar pts) (cadadr pts)); else -- X of current point, Y of next point
                ); if
                (cadr pts); then next point
              ); command
              (setq pts (cdr pts)); remove current point
            ); while
            (command (car pts) ""); finish Polyline
          ); progn
        ); if
      ); repeat [each Polyline]
    ); progn
    (prompt "\nNo Polyline(s) selected."); else
  ); if [selection]
  (mapcar 'setvar svnames svvals); reset System Variables
  (vla-endundomark doc)
  (princ)
); defun -- C:STEP-15&lt;/LI-CODE&gt;
&lt;P&gt;If you want to have both varieties available, change the command name in one of them.&lt;/P&gt;</description>
      <pubDate>Sun, 05 Sep 2021 23:01:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/10601558#M95249</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-09-05T23:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: Need lisp for polyline</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/10601864#M95250</link>
      <description>&lt;P&gt;It appears we are talking about roads here so rather than fix up the cross sections I would suggest do it at the design stage software like "Civil Site Design" has "Intelligent sections" that does the task of multi facet batters for you. The advantage is stuff like volumes etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do a google for "Intelligent sections Civil Site Designs" there are some youtube videos.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Sep 2021 03:56:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/10601864#M95250</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2021-09-06T03:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: Need lisp for polyline</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/10602242#M95251</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt; !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wow - thank you sooo much - it works. Would it be complicate to install a short request in the AutoCAD commando line for inserting a individual high for the steps? Otherwise I only have to change the value 0.15 in the lisp-code - not that bing deal - thats even possible for me :).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;kind regards from Germany&lt;/P&gt;&lt;P&gt;Stephan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Sep 2021 07:59:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/10602242#M95251</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-06T07:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: Need lisp for polyline</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/10602683#M95252</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;.... Would it be complicate to install a short request in the AutoCAD commando line for inserting a individual high for the steps? ....&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That is probably not complicated, but I'm not quite sure exactly what you mean by it.&amp;nbsp; Can you post an image or sample drawing pointing with notes indicating what you're starting with and the kind of result you want?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Sep 2021 11:33:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-for-polyline/m-p/10602683#M95252</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-09-06T11:33:05Z</dc:date>
    </item>
  </channel>
</rss>

