<?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: Generate central 3DPoly between two parallel 3DPolys (variable offset) in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13718811#M165148</link>
    <description>&lt;P&gt;your welcome. surely that will do for the&amp;nbsp; straight-segment-only lw plines.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Jul 2025 06:30:25 GMT</pubDate>
    <dc:creator>komondormrex</dc:creator>
    <dc:date>2025-07-10T06:30:25Z</dc:date>
    <item>
      <title>Generate central 3DPoly between two parallel 3DPolys (variable offset)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13716763#M165121</link>
      <description>&lt;P&gt;I have two 3DPolylines in 3D space that run roughly parallel but with variable offset between them. I need to generate a third 3DPolyline representing the central axis between both. Is this possible using LISP? Any suggestions or sample routines are welcome.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rsalastopografia_0-1752027704290.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1550544i83E223C71C985F51/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rsalastopografia_0-1752027704290.png" alt="rsalastopografia_0-1752027704290.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The attached image shows two parallel 3DPolylines with non-uniform spacing. The goal is to generate a central 3DPolyline equidistant (or interpolated) between them along their entire length.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jul 2025 02:22:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13716763#M165121</guid>
      <dc:creator>rsalastopografia</dc:creator>
      <dc:date>2025-07-09T02:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Generate central 3DPoly between two parallel 3DPolys (variable offset)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13717182#M165124</link>
      <description>&lt;P&gt;If there’s the same number of vertices on each polyline, then you can build a new polyline from the mid points. I have no idea how to do this in lisp, but maybe this will give a hint&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import traceback
from pyrx import Ap, Ax, Db, Ed, Ge, Gi


@Ap.Command()
def doit():
    try:
        db = Db.curDb()
        ps, id1, _ = Ed.Editor.entSel("\nPick p1", Db.Polyline3d.desc())
        ps, id2, _ = Ed.Editor.entSel("\nPick p2", Db.Polyline3d.desc())
        
        pl1 = Db.Polyline3d(id1)
        pl2 = Db.Polyline3d(id2)
        
        vtxids1 = pl1.vertexIds()
        vtxids2 = pl2.vertexIds()
        
        if len(vtxids1) != len(vtxids2):
            return 
        
        pnts = []
        for vid1, vid2 in zip(vtxids1,vtxids2):
            v1 = Db.Polyline3dVertex(vid1)
            v2 = Db.Polyline3dVertex(vid2)
            seg = Ge.LineSeg3d(v1.position(),v2.position())
            pnts.append(seg.midPoint())
            
        pl3 = Db.Polyline3d(Db.Poly3dType.k3dSimplePoly,pnts,pl1.isClosed())
        db.addToCurrentspace(pl3)
        print("\nWooHoo!")
        
    except Exception as err:
        traceback.print_exception(err)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mid.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1550628i0C77441D679677C5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mid.png" alt="mid.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 09 Jul 2025 07:52:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13717182#M165124</guid>
      <dc:creator>daniel_cadext</dc:creator>
      <dc:date>2025-07-09T07:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: Generate central 3DPoly between two parallel 3DPolys (variable offset)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13717330#M165128</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7267338"&gt;@rsalastopografia&lt;/a&gt;&lt;/P&gt;&lt;P&gt;check this lisped one&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(defun c:draw_mid_3dpoly ()
  (setq 3d_pline_1 (vlax-ename-&amp;gt;vla-object (car (entsel "\nPick 1st 3d-pline: ")))
      3d_pline_2 (vlax-ename-&amp;gt;vla-object (car (entsel "\nPick 2nd 3d-pline: ")))
      vertex_index 0
      3d_mid_vertices_list nil
  )
  (while (and (null (vl-catch-all-error-p (setq vertex_1 (vl-catch-all-apply 'vla-get-coordinate (list 3d_pline_1 vertex_index)))))
             (setq vertex_1 (vlax-safearray-&amp;gt;list (vlax-variant-value vertex_1)))
        (null (vl-catch-all-error-p (setq vertex_2 (vl-catch-all-apply 'vla-get-coordinate (list 3d_pline_2 vertex_index)))))
        (setq 3d_mid_vertices_list (append 3d_mid_vertices_list (mapcar '* '(0.5 0.5 0.5) (mapcar '+ vertex_1 (vlax-safearray-&amp;gt;list (vlax-variant-value vertex_2))))))
        (setq vertex_index (1+ vertex_index)) 
       )
  )
  (vla-add3dpoly (vla-get-block (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object))))
           (vlax-safearray-fill (vlax-make-safearray vlax-vbdouble (cons 1 (length 3d_mid_vertices_list)))
                      3d_mid_vertices_list
           )
  )
  (princ)
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 09 Jul 2025 09:52:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13717330#M165128</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2025-07-09T09:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: Generate central 3DPoly between two parallel 3DPolys (variable offset)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13718148#M165140</link>
      <description>&lt;P&gt;Thank you very much for your help!&lt;BR /&gt;The Lisp routine worked perfectly. I really appreciate your time and knowledge.&lt;/P&gt;&lt;P&gt;If I wanted to create a 2D polyline as the centerline, I would just use vla-addLightWeightPolyline instead of vla-add3dpoly and work only with XY coordinates.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jul 2025 18:16:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13718148#M165140</guid>
      <dc:creator>rsalastopografia</dc:creator>
      <dc:date>2025-07-09T18:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Generate central 3DPoly between two parallel 3DPolys (variable offset)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13718811#M165148</link>
      <description>&lt;P&gt;your welcome. surely that will do for the&amp;nbsp; straight-segment-only lw plines.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jul 2025 06:30:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13718811#M165148</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2025-07-10T06:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: Generate central 3DPoly between two parallel 3DPolys (variable offset)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13719825#M165161</link>
      <description>&lt;P&gt;Here's another AutoLisp approach [lightly tested]:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(defun C:3DPMID (/ pl1 pl2 o1 o2 co1 co2)
  (setq
    pl1 (car (entsel "\nFirst 3D Polyline: "))
    pl2 (car (entsel "\nSecond 3D Polyline: "))
  ); setq
  (if
    ;; [correct object types, same number of segments, &amp;amp;
    ;;   either both closed or both open]
    (and
      (=
        (cdr (assoc 100 (reverse (entget pl1))))
        (cdr (assoc 100 (reverse (entget pl1))))
        "AcDb3dPolyline"
      ); =
      (= (vlax-curve-getEndParam pl1) (vlax-curve-getEndParam pl2))
      (= (vlax-curve-isClosed pl1) (vlax-curve-isClosed pl1))
    ); and
    (progn ; then
      (setq
        o1 (vlax-ename-&amp;gt;vla-object pl1)
        o2 (vlax-ename-&amp;gt;vla-object pl2)
        co1 (vlax-get o1 'Coordinates)
        co2 (vlax-get o2 'Coordinates)
      ); setq
      (command "_.copy" pl1 "" '(0 0 0) '(0 0 0)); a copy to get new Coordinates
      (vlax-put
        (vlax-ename-&amp;gt;vla-object (entlast))
        'Coordinates (mapcar '(lambda (x y) (/ (+ x y) 2)) co1 co2)
      ); vlax-put
    ); progn
  ); if
  (prin1)
)&lt;/LI-CODE&gt;
&lt;P&gt;The actual work of it is just the second half -- kind of short and sweet.&amp;nbsp; The first half is all just selection and verifying the right match of characteristics.&lt;/P&gt;
&lt;P&gt;If the two selected 3DPolylines are not the same in all properties [Layer, linetype, color, etc.], the mid-path result with have those of the first one selected.&lt;/P&gt;
&lt;P&gt;[It could have a prompt added to scold the User if the appropriate characteristics don't match.]&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jul 2025 17:49:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13719825#M165161</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2025-07-10T17:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Generate central 3DPoly between two parallel 3DPolys (variable offset)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13721318#M165164</link>
      <description>&lt;P&gt;*IF* there's ever a need to batch process more than one pair, a &lt;EM&gt;slight&lt;/EM&gt; mod (using vla-copy in lieu of COPY Command) makes your code exceptionally fast:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;_3DPMID&lt;BR /&gt;Elapsed: 25781&lt;BR /&gt;Average: 25.7810&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;_3DPMID2&lt;BR /&gt;Elapsed: 4079&lt;BR /&gt;Average: 4.0790&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(defun _3DPMID (pl1 pl2 / o1 o2 co1 co2)
;;;  (setq
;;;    pl1 (car (entsel "\nFirst 3D Polyline: "))
;;;    pl2 (car (entsel "\nSecond 3D Polyline: "))
;;;  )
  (if
    ;; [correct object types, same number of segments, &amp;amp;
    ;;   either both closed or both open]
    (and
      (=
        (cdr (assoc 100 (reverse (entget pl1))))
        (cdr (assoc 100 (reverse (entget pl1))))
        "AcDb3dPolyline"
      ); =
      (= (vlax-curve-getEndParam pl1) (vlax-curve-getEndParam pl2))
      (= (vlax-curve-isClosed pl1) (vlax-curve-isClosed pl1))
    ); and
    (progn ; then
      (setq
        o1 (vlax-ename-&amp;gt;vla-object pl1)
        o2 (vlax-ename-&amp;gt;vla-object pl2)
        co1 (vlax-get o1 'Coordinates)
        co2 (vlax-get o2 'Coordinates)
      ); setq
      (command "_.copy" pl1 "" '(0 0 0) '(0 0 0)); a copy to get new Coordinates
      (vlax-put
        (vlax-ename-&amp;gt;vla-object (entlast))
        'Coordinates (mapcar '(lambda (x y) (/ (+ x y) 2)) co1 co2)
      ); vlax-put
    ); progn
  ); if
  (prin1)
)

(defun _3DPMID2 (pl1 pl2 / o1 o2 co1 co2)
;;;  (setq
;;;    pl1 (car (entsel "\nFirst 3D Polyline: "))
;;;    pl2 (car (entsel "\nSecond 3D Polyline: "))
;;;  )
  (if
    ;; [correct object types, same number of segments, &amp;amp;
    ;;   either both closed or both open]
    (and
      (=
        (cdr (assoc 100 (reverse (entget pl1))))
        (cdr (assoc 100 (reverse (entget pl1))))
        "AcDb3dPolyline"
      ); =
      (= (vlax-curve-getEndParam pl1) (vlax-curve-getEndParam pl2))
      (= (vlax-curve-isClosed pl1) (vlax-curve-isClosed pl1))
    ); and
    (progn ; then
      (setq
        o1 (vlax-ename-&amp;gt;vla-object pl1)
        o2 (vlax-ename-&amp;gt;vla-object pl2)
        co1 (vlax-get o1 'Coordinates)
        co2 (vlax-get o2 'Coordinates)
      ); setq
      ;;(command "_.copy" pl1 "" '(0 0 0) '(0 0 0)); a copy to get new Coordinates
      (vlax-put
        (vla-copy o1)
        'Coordinates (mapcar '(lambda (x y) (/ (+ x y) 2)) co1 co2)
      ); vlax-put
    ); progn
  ); if
  (prin1)
)
;; (_3DPMID2  pl1 pl2)

(bench '(_3DPMID _3DPMID2) (list pl1 pl2) 1000)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jul 2025 15:17:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13721318#M165164</guid>
      <dc:creator>BlackBox_</dc:creator>
      <dc:date>2025-07-11T15:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: Generate central 3DPoly between two parallel 3DPolys (variable offset)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13721835#M165173</link>
      <description>&lt;P&gt;I changed the 3dpoly Lisp code to polyline in its properties so that it would generate a central axis, but it doesn't run correctly. In the case of 2d Polyline, does the entire configuration of the original Lisp routine code change?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jul 2025 21:30:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13721835#M165173</guid>
      <dc:creator>rsalastopografia</dc:creator>
      <dc:date>2025-07-11T21:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: Generate central 3DPoly between two parallel 3DPolys (variable offset)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13722253#M165180</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7267338"&gt;@rsalastopografia&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I changed the 3dpoly Lisp code to polyline ... but it doesn't run correctly. ....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;"[I]t doesn't run correctly" is &lt;EM&gt;&lt;STRONG&gt;never enough information&lt;/STRONG&gt;&lt;/EM&gt;.&amp;nbsp; What does it do differently from what you expect?&lt;/P&gt;
&lt;P&gt;If by that change you mean you changed&amp;nbsp;"AcDb&lt;STRONG&gt;3d&lt;/STRONG&gt;Polyline" to&amp;nbsp;"AcDbPolyline" [which will accept only "lightweight" Polylines], that works for me.&amp;nbsp; If you changed it to&amp;nbsp;"AcDb&lt;STRONG&gt;2d&lt;/STRONG&gt;Polyline" ["heavy" but planar], that also works for me.&amp;nbsp; But in both cases, if the two are not at the same elevation, the result is at the elevation of the first one.&amp;nbsp; Listing its VLA Properties, it has the Elevation property of that one, but the Coordinates property in the "heavy" 2D version has the every-third-element Z coordinates &lt;EM&gt;correctly at halfway between&lt;/EM&gt; those of the originals.&amp;nbsp; So I guess the Elevation property overrides the Z coordinates of the individual vertices, and stands in place of the Z coordinates in a LWPolyline, so it's necessary to change that Elevation property, too.&amp;nbsp; But I'm not sure what should happen if they are not in parallel planes -- halfway between vertex by vertex is probably not possible except with a 3DPolyline.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Jul 2025 12:37:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13722253#M165180</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2025-07-12T12:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Generate central 3DPoly between two parallel 3DPolys (variable offset)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13723341#M165201</link>
      <description>&lt;P&gt;Please could you upload the Lisp routine code that works with 2d polyline? I changed the code (3dpoly to 2d polyline) but it didn't work as expected, I don't know why.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jul 2025 01:42:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13723341#M165201</guid>
      <dc:creator>rsalastopografia</dc:creator>
      <dc:date>2025-07-14T01:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Generate central 3DPoly between two parallel 3DPolys (variable offset)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13723833#M165209</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7267338"&gt;@rsalastopografia&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;....I changed the code (3dpoly to 2d polyline) but it didn't work as expected.....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Again, "it didn't work" is not enough information.&amp;nbsp; What did it do differently from what you expect?&lt;/P&gt;
&lt;P&gt;If you changed it to "2d polyline" &lt;STRONG&gt;&lt;EM&gt;with that space&lt;/EM&gt;&lt;/STRONG&gt;, that would not work.&amp;nbsp; Show us the change you made.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jul 2025 10:10:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13723833#M165209</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2025-07-14T10:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Generate central 3DPoly between two parallel 3DPolys (variable offset)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13723866#M165210</link>
      <description>&lt;P&gt;For a Polyline, you would probably need to set the elevation to the Z value of one of the vertices. An issue is that the original polylines have a slope. Trying to compute a transformation matrix in lisp is like trying to drive a F150 with a toilet bowl plunger as the gear shift. Maybe a min, max or average Z is good enough. This sample uses max to illustrate the issue&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;.Command()
def doit():
    try:
        db = Db.curDb()
        ps, id1, _ = Ed.Editor.entSel("\nPick p1", Db.Polyline3d.desc())
        ps, id2, _ = Ed.Editor.entSel("\nPick p2", Db.Polyline3d.desc())
        
        pl1 = Db.Polyline3d(id1)
        pl2 = Db.Polyline3d(id2)
        
        vtxids1 = pl1.vertexIds()
        vtxids2 = pl2.vertexIds()
        
        if len(vtxids1) != len(vtxids2):
            return 
        
        pnts = []
        for vid1, vid2 in zip(vtxids1,vtxids2):
            v1 = Db.Polyline3dVertex(vid1)
            v2 = Db.Polyline3dVertex(vid2)
            seg = Ge.LineSeg3d(v1.position(),v2.position())
            pnts.append(seg.midPoint())
            
        z = 0
        for p in pnts:
            z = max(z,p.z)
            
        pl3 = Db.Polyline(pnts)
        pl3.setElevation(z)
        
        db.addToCurrentspace(pl3)
        print("\nWooHoo!")
        
    except Exception as err:
        traceback.print_exception(err)&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="slope.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1552162iDC7032333D130DBB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="slope.png" alt="slope.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 14 Jul 2025 10:44:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13723866#M165210</guid>
      <dc:creator>daniel_cadext</dc:creator>
      <dc:date>2025-07-14T10:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: Generate central 3DPoly between two parallel 3DPolys (variable offset)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13723900#M165211</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7267338"&gt;@rsalastopografia&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;check the following for any matched pair of *plines.&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(defun c:draw_mid_poly ()
  (setq pline_1 (vlax-ename-&amp;gt;vla-object (car (entsel "\nPick 1st *pline: ")))
        pline_2 (vlax-ename-&amp;gt;vla-object (car (entsel "\nPick 2nd *pline: ")))
        vertex_index 0
        mid_vertices_list nil
  )
  (if (and (wcmatch (vla-get-objectname pline_1) "*Polyline")
          (wcmatch (vla-get-objectname pline_2) "*Polyline")
      )
    (progn
      (while (and (null (vl-catch-all-error-p (setq vertex_1 (vl-catch-all-apply 'vla-get-coordinate (list pline_1 vertex_index)))))
             (setq vertex_1 (vlax-safearray-&amp;gt;list (vlax-variant-value vertex_1)))
            (null (vl-catch-all-error-p (setq vertex_2 (vl-catch-all-apply 'vla-get-coordinate (list pline_2 vertex_index)))))
              (setq vertex_2 (vlax-safearray-&amp;gt;list (vlax-variant-value vertex_2)))
            (setq mid_vertices_list (append mid_vertices_list (mapcar '* '(0.5 0.5 0.5) (mapcar '+ vertex_1 vertex_2))))
            (setq vertex_index (1+ vertex_index)) 
              )
      )
      (setq vertices_raw_array (vlax-safearray-fill (vlax-make-safearray vlax-vbdouble (cons 1 (length mid_vertices_list)))
                                    mid_vertices_list
                     )
      )
      (cond
        ((= "AcDbPolyline" (vla-get-objectname pline_1) (vla-get-objectname pline_2))
              (vla-put-elevation
              (vla-addlightweightpolyline (vla-get-block (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object))))
                            vertices_raw_array
              )
            (* 0.5 (+ (vla-get-elevation pline_1) (vla-get-elevation pline_2)))
          )
        )
          ((= "AcDb2dPolyline" (vla-get-objectname pline_1) (vla-get-objectname pline_2))
            (vla-put-elevation
            (vla-addpolyline (vla-get-block (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object))))
                      vertices_raw_array
              )
            (* 0.5 (+ (vla-get-elevation pline_1) (vla-get-elevation pline_2)))
          )
          )
          ((= "AcDb3dPolyline" (vla-get-objectname pline_1) (vla-get-objectname pline_2))
              (vla-add3dpoly (vla-get-block (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object))))
                          vertices_raw_array
              )
          )
        (t (princ "\nPlines' mismatch"))
       )
    )
  )
    (princ)
)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 14 Jul 2025 13:13:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13723900#M165211</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2025-07-14T13:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: Generate central 3DPoly between two parallel 3DPolys (variable offset)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13724884#M165221</link>
      <description>&lt;P&gt;The lisp routine code for polyline runs perfectly, thanks for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2025 01:27:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/generate-central-3dpoly-between-two-parallel-3dpolys-variable/m-p/13724884#M165221</guid>
      <dc:creator>rsalastopografia</dc:creator>
      <dc:date>2025-07-15T01:27:47Z</dc:date>
    </item>
  </channel>
</rss>

