<?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: Straighten polyline with viewports in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9542097#M131479</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6254908"&gt;@Sea-Haven&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;...solution exists in that you can take a pline and set spacings and auto create mviews on multiple layouts this code has existed for a long time.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I would loved to see that code. Is that the one that creates&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;named&lt;/STRONG&gt; views with boundaries&amp;nbsp; of different rotations?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 27 May 2020 05:13:15 GMT</pubDate>
    <dc:creator>pbejse</dc:creator>
    <dc:date>2020-05-27T05:13:15Z</dc:date>
    <item>
      <title>Straighten polyline with viewports</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/6383191#M131464</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Model space and 2Dpolyline.&lt;/P&gt;&lt;P&gt;Lisp should&amp;nbsp;create viewports - straighten polyline.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each viewport: height 20 mm, length = polyline segment length. Viewport scale 2.0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/247604iDDE2636F9C4002EF/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="Capture1.PNG" title="Capture1.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2016 18:05:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/6383191#M131464</guid>
      <dc:creator>alar</dc:creator>
      <dc:date>2016-06-14T18:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: Straighten polyline with viewports</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/6383409#M131465</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1173227"&gt;@alar&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;....&amp;nbsp;straighten polyline.&lt;/P&gt;
&lt;P&gt;....&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Since you don't say exactly what you're going to do with those Viewports,&amp;nbsp;the following&amp;nbsp;may not work for you, but....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It doesn't do it by way of Viewports, but &lt;A href="https://forums.autodesk.com/t5/autocad-2013-2014-2015-2016-2017/uncurling-polyline-into-straight-line/m-p/5432721#M67472" target="_self"&gt;this&lt;/A&gt; defines&amp;nbsp;an &lt;STRONG&gt;SPS&lt;/STRONG&gt; command [= &lt;STRONG&gt;S&lt;/STRONG&gt;tretch &lt;STRONG&gt;P&lt;/STRONG&gt;olyline(s) &lt;STRONG&gt;S&lt;/STRONG&gt;traight] that straightens Polylines out into linear Polylines with all the same segment lengths -- as many as you want to do at once, LW or "heavy," and including straightening arc segments.&amp;nbsp; [It doesn't &lt;EM&gt;change&lt;/EM&gt; the selected Polyline(s), but adds new one(s) extending 0--degree-ward from the start point(s) of the selected one(s).]&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2016 19:41:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/6383409#M131465</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2016-06-14T19:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: Straighten polyline with viewports</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/6386592#M131466</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The polyline is like a target.Its a pipeline, and I'd like to use that LISP for straighten-piping-layout&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like that&lt;/P&gt;&lt;P&gt;Model view. Target polyline - [blue ---2T---&amp;nbsp; ---]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/248086iDC2DABBD9AB5233B/image-size/original?v=v2&amp;amp;px=-1" alt="Capture1.JPG" title="Capture1.JPG" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And final result for paperspace&lt;/P&gt;&lt;P&gt;Polyline --2T---- is like "straightened"&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/248089i7AB1EF9BE19FE4F8/image-size/original?v=v2&amp;amp;px=-1" alt="Paperspace.JPG" title="Paperspace.JPG" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 06:26:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/6386592#M131466</guid>
      <dc:creator>alar</dc:creator>
      <dc:date>2016-06-16T06:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: Straighten polyline with viewports</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9539326#M131467</link>
      <description>&lt;P&gt;Love this topic , but sadly it dosen't have solution !&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 03:56:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9539326#M131467</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-26T03:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Straighten polyline with viewports</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9539376#M131468</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp; 已写:&lt;BR /&gt;&lt;P&gt;Love this topic , but sadly it dosen't have solution !&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I think there should be a solution of LISP code.&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 05:25:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9539376#M131468</guid>
      <dc:creator>sby0531</dc:creator>
      <dc:date>2020-05-26T05:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: Straighten polyline with viewports</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9539469#M131469</link>
      <description>&lt;P&gt;&amp;nbsp; yes, but i think it's quite complex to write so.&amp;nbsp;&lt;BR /&gt;Hopefully someone will firgue out!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 06:44:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9539469#M131469</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-26T06:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: Straighten polyline with viewports</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9540109#M131470</link>
      <description>&lt;P&gt;Is your requirement exactly the same as the OP? right down to the size and units?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 11:44:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9540109#M131470</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2020-05-26T11:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: Straighten polyline with viewports</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9540194#M131471</link>
      <description>&lt;P&gt;Here is a partial solution.&lt;/P&gt;&lt;P&gt;Feel free to add your favorite error trap and some other settings (WCS/UCS, Layers, selection check etc)&lt;/P&gt;&lt;P&gt;I'd like to improve it, but I don't have the time right now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Edit: It doesn't work if a layout has a space in it's name.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:test ( / m2p acobj acdoc e sc h p lst layouts layout p)
  (vl-load-com)

  (defun m2p (a b) (mapcar '(lambda (a b) (/ (+ a b) 2.0)) a b))
  
  (setq acobj (vlax-get-acad-object)
        acdoc  (vla-get-activedocument acobj)
  )
  
  (if
    (and
      (setq e (entsel "\nSelect polyline: "))
      (progn
        (initget 6)
        (setq sc (getreal "\nSpecify vports scale 1:"))
      )
      (progn
        (initget 6)
        (setq h (getdist "\nSpecify vport height in PS units: "))
      )
    )
    (progn
      (setq p (cadr e)
            e (car e)
      )
      (setq lst (mapcar 'cdr (vl-remove-if '(lambda (x) (/= (car x) 10)) (entget e))))
      (if
        (&amp;gt;
          (vlax-curve-getdistatpoint e
            (vlax-curve-getclosestpointto e p)
          )
          (/
            (vlax-curve-getdistatparam e
              (vlax-curve-getendparam e)
            )
            2.0
          )
        )
        (setq lst (reverse lst))
      )
      (if
        (progn
          (setq layouts (layoutlist))
          (initget (substr
                     (apply 'strcat
                       (mapcar '(lambda (x) (strcat " " x)) layouts)
                     )
                     2
                   )
          )
          (setq layout (getkword
                         (strcat
                           "\nSpecify destination layout ["
                            (substr
                              (apply 'strcat
                                (mapcar '(lambda (x) (strcat "/" x)) layouts)
                              )
                              2
                            )
                            "]: "
                         )
                       )
          )
        )
        (progn
          (setvar 'ctab layout)
          (vla-put-mspace acdoc :vlax-false)
          (if
            (setq p (getpoint "\nSpecify insertion point: "))
            (mapcar
              '(lambda (p1 p2 / vp)
                 (command
                   "_mview"
                   "_non" p
                   "_non" (mapcar '+ p (list (/ (distance p1 p2) sc) h))
                 )
                 (setq vp (vlax-ename-&amp;gt;vla-object (entlast)))
                 (vla-put-twistangle vp (- (+ pi pi) (angle p1 p2)))
                 (vla-zoomextents acobj)
                 (vla-put-mspace acdoc :vlax-true)
                 (vla-put-activepviewport acdoc vp)
                 (vla-zoomcenter acobj (vlax-3d-point (m2p p1 p2)) (* h sc))
                 (vla-put-mspace acdoc :vlax-false)
                 (setq p (mapcar '+ p (list (/ (distance p1 p2) sc) 0.0)))
               )
              lst (cdr lst)
            )
          )
        )
      )
    )
  )
  (princ)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 12:31:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9540194#M131471</guid>
      <dc:creator>phanaem</dc:creator>
      <dc:date>2020-05-26T12:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: Straighten polyline with viewports</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9540363#M131472</link>
      <description>&lt;P&gt;Nice Stefan&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 13:13:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9540363#M131472</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2020-05-26T13:13:57Z</dc:date>
    </item>
    <item>
      <title>Re: Straighten polyline with viewports</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9540481#M131473</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;&amp;nbsp; 已写:&lt;BR /&gt;&lt;P&gt;Here is a partial solution.&lt;/P&gt;&lt;P&gt;Feel free to add your favorite error trap and some other settings (WCS/UCS, Layers, selection check etc)&lt;/P&gt;&lt;P&gt;I'd like to improve it, but I don't have the time right now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Edit: It doesn't work if a layout has a space in it's name.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:test ( / m2p acobj acdoc e sc h p lst layouts layout p)
  (vl-load-com)

  (defun m2p (a b) (mapcar '(lambda (a b) (/ (+ a b) 2.0)) a b))
  
  (setq acobj (vlax-get-acad-object)
        acdoc  (vla-get-activedocument acobj)
  )
  
  (if
    (and
      (setq e (entsel "\nSelect polyline: "))
      (progn
        (initget 6)
        (setq sc (getreal "\nSpecify vports scale 1:"))
      )
      (progn
        (initget 6)
        (setq h (getdist "\nSpecify vport height in PS units: "))
      )
    )
    (progn
      (setq p (cadr e)
            e (car e)
      )
      (setq lst (mapcar 'cdr (vl-remove-if '(lambda (x) (/= (car x) 10)) (entget e))))
      (if
        (&amp;gt;
          (vlax-curve-getdistatpoint e
            (vlax-curve-getclosestpointto e p)
          )
          (/
            (vlax-curve-getdistatparam e
              (vlax-curve-getendparam e)
            )
            2.0
          )
        )
        (setq lst (reverse lst))
      )
      (if
        (progn
          (setq layouts (layoutlist))
          (initget (substr
                     (apply 'strcat
                       (mapcar '(lambda (x) (strcat " " x)) layouts)
                     )
                     2
                   )
          )
          (setq layout (getkword
                         (strcat
                           "\nSpecify destination layout ["
                            (substr
                              (apply 'strcat
                                (mapcar '(lambda (x) (strcat "/" x)) layouts)
                              )
                              2
                            )
                            "]: "
                         )
                       )
          )
        )
        (progn
          (setvar 'ctab layout)
          (vla-put-mspace acdoc :vlax-false)
          (if
            (setq p (getpoint "\nSpecify insertion point: "))
            (mapcar
              '(lambda (p1 p2 / vp)
                 (command
                   "_mview"
                   "_non" p
                   "_non" (mapcar '+ p (list (/ (distance p1 p2) sc) h))
                 )
                 (setq vp (vlax-ename-&amp;gt;vla-object (entlast)))
                 (vla-put-twistangle vp (- (+ pi pi) (angle p1 p2)))
                 (vla-zoomextents acobj)
                 (vla-put-mspace acdoc :vlax-true)
                 (vla-put-activepviewport acdoc vp)
                 (vla-zoomcenter acobj (vlax-3d-point (m2p p1 p2)) (* h sc))
                 (vla-put-mspace acdoc :vlax-false)
                 (setq p (mapcar '+ p (list (/ (distance p1 p2) sc) 0.0)))
               )
              lst (cdr lst)
            )
          )
        )
      )
    )
  )
  (princ)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;Your code is helpful and worth learning to me. But why don't you like closing the parens at the same line? Almost all the common lisp programmer always do so. And I think the lisp codes looks more concise and compact if the closing&amp;nbsp;parens are placed at the same line.&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 13:53:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9540481#M131473</guid>
      <dc:creator>sby0531</dc:creator>
      <dc:date>2020-05-26T13:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: Straighten polyline with viewports</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9540544#M131474</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8706970"&gt;@sby0531&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Your code is helpful and worth learning to me. But why don't you like closing the parens at the same line? Almost all the common lisp programmer always do so. And I think the lisp codes looks more concise and compact if the closing&amp;nbsp;parens are placed at the same line.&lt;/BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;It is the way VLIDE (auto)format the code. And you can easily pair them visually if they are closed on the same column.&lt;/P&gt;&lt;P&gt;So, it's the habit. In-line style is not so common among the AutoLispers.&lt;/P&gt;&lt;P&gt;Plus, someone might ask, why limit to the parenthesis only, why not all the code in one single line?&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 14:14:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9540544#M131474</guid>
      <dc:creator>phanaem</dc:creator>
      <dc:date>2020-05-26T14:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Straighten polyline with viewports</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9540779#M131475</link>
      <description>&lt;P&gt;oh maybe , i'm not sure... but i think the OP mean that (he/she) want to create multiple viewports by selecting a polyline or alignment from model in a layout or multiple layouts and besides all the viewports have&amp;nbsp;the coordinate axis rotated exactly in the same direction so it can look like a&amp;nbsp;straight polyline.&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 15:33:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9540779#M131475</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-26T15:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Straighten polyline with viewports</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9540906#M131476</link>
      <description>&lt;P&gt;Amazing ! Thank you .&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 16:22:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9540906#M131476</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-26T16:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: Straighten polyline with viewports</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9541848#M131477</link>
      <description>&lt;P&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;It is normal practice to show the plan view in a true orientation&lt;/STRONG&gt;&lt;/FONT&gt;, 40 years Civil Engineer, but in saying this you are asking for a over the top solution when a simple answer is actually available and that is to use a ucs in your viewport that covers the range of the long section.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This type of approach is built in to software like CIV3D Civilsite etc. They auto make the layouts and work out the ucs orientation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ok manual way very easy, draw a line from start point chainage to end chainage of your pipe for each layout section. Check that lines have Z set to 0 use properties, take your long section layout add a mview, go into view say zoom e, then UCS OB select match line section, pick left side, then type plan, your view will rotate to that orientation, set viewport scale and your nearly there, pan to approx. long section. Ok now to align a chainage, simply draw a vertical line in Mspace from a chainage of your long section, you can "move" the mview window select the correct chainage point of the mview stay in mspace then use say perp and the mview will be correctly aligned. Lock viewport, next viewport you may need to type UCS W Plan to reset view orientation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes it could be automated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For all those that have posted sorry but the solution exists in that you can take a pline and set spacings and auto create mviews on multiple layouts this code has existed for a long time.&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="screenshot206.png" style="width: 777px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/775948iDD3FC3FC13BA2609/image-size/large?v=v2&amp;amp;px=999" role="button" title="screenshot206.png" alt="screenshot206.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2020 00:00:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9541848#M131477</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2020-05-27T00:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: Straighten polyline with viewports</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9542075#M131478</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;oh maybe , i'm not sure... but i think the OP mean that (he/she) want to create multiple viewports by selecting a polyline or alignment from model in a layout or multiple layouts and besides all the viewports have&amp;nbsp;the coordinate axis rotated exactly in the same direction so it can look like a&amp;nbsp;straight polyline.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, maybe for the OP, but what i'm asking, is that your requirement? Since you were the one who "zombified"&amp;nbsp; this discussion&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or your&amp;nbsp; interest on this discussion is for learning&amp;nbsp;and not necessarily a need for this specific routine ? or both?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2020 04:53:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9542075#M131478</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2020-05-27T04:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: Straighten polyline with viewports</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9542097#M131479</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6254908"&gt;@Sea-Haven&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;...solution exists in that you can take a pline and set spacings and auto create mviews on multiple layouts this code has existed for a long time.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I would loved to see that code. Is that the one that creates&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;named&lt;/STRONG&gt; views with boundaries&amp;nbsp; of different rotations?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2020 05:13:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9542097#M131479</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2020-05-27T05:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Straighten polyline with viewports</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9542324#M131480</link>
      <description>&lt;P&gt;thanks for your reply!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;haha&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp;ok...so my requirment is the same with OP and i'm looking for a lisp that can solve this issue automatically.&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2020 07:47:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9542324#M131480</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-27T07:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: Straighten polyline with viewports</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9544667#M131481</link>
      <description>&lt;P&gt;Pbejse I think your right about the views option I don't have a copy as I use software that does it automatically, but have done it manually as suggested. The code would set a rectangle based on a scale and sheet size making the mview to suit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have never seen say a curved road pipe plan straightened. Certainly rotated around X axis to suit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had 12 roads 1 dwg each road profile had a plan view parallel to the road alignment say 30+ sheets auto generated.&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2020 01:43:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/straighten-polyline-with-viewports/m-p/9544667#M131481</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2020-05-28T01:43:54Z</dc:date>
    </item>
  </channel>
</rss>

