Results 1 to 4 of 4

Thread: Extend a 3D line at the same slope

  1. #1
    100 Club
    Join Date
    2016-04
    Location
    California
    Posts
    150
    Login to Give a bone
    0

    Default Extend a 3D line at the same slope

    Hello,
    I have a 3D polyline that is determined by two end points of known elevation. Thus the slope of the line is known by ACAD. Is there a way to extend this 3D polyline so that the slope of the original line is continued? I am using version 2017 Civil 3D.

    Thanks

  2. #2
    Certified AUGI Addict cadtag's Avatar
    Join Date
    2000-12
    Location
    Cairo - no, not Illinois
    Posts
    5,069
    Login to Give a bone
    0

    Default Re: Extend a 3D line at the same slope

    extend, lengthen... either will work and neither will impact the slope of the pline

  3. #3
    100 Club
    Join Date
    2016-04
    Location
    California
    Posts
    150
    Login to Give a bone
    0

    Default Re: Extend a 3D line at the same slope

    I was trying to use the end grips to lengthen the line. This only works with level lines, at least in the 2017 version. What I figured out though is that if you create the line with the "Create Line from Point Objects" command, them select the cogo points, a 3D line is created that you can extend or lengthen with grips just like a level line. It somehow overrides the requirement to be a level line.

    In the spirit of AUGI, passing on information.

  4. #4
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Extend a 3D line at the same slope

    Quote Originally Posted by tadthurston725387 View Post
    I was trying to use the end grips to lengthen the line. This only works with level lines, at least in the 2017 version. What I figured out though is that if you create the line with the "Create Line from Point Objects" command, them select the cogo points, a 3D line is created that you can extend or lengthen with grips just like a level line. It somehow overrides the requirement to be a level line.

    In the spirit of AUGI, passing on information.
    All lines are 3D, look in Properties and you will see X, Y, & Z values for each endpoint.

    Old routine to modify the length of a line using horizontal distances, or to an elevation, or by a Percent or Ratio.
    Code:
    ;| Change the Length of a Line|;
    ; BY: Tom Beauford
    ; BeaufordT@LeonCountyFL.gov
    ; Leon County Public Works Engineering
    ;(or C:chl (load "ChgLen.lsp"));chl
    ; (load "ChgLen.lsp") chl
    ;=======================================================
    (defun C:chl (/ ActDoc A pick B etype pt1 pt pt2 pt3 pt4 distold dist1 ang1 z1)
      (setq ActDoc (vla-get-ActiveDocument (vlax-get-Acad-Object)))
      (vla-StartUndoMark ActDoc)
      (setq A (entsel "\nSelect Entity: ")
         pick (osnap (cadr A) "endp")
            B (entget (car A))
        etype (cdr(assoc 0 B))
      ); setq
      (princ "\netype = ")
      (princ etype)
      (cond
        ((eq etype "LINE")
          (progn
            (setq pt1 (cdr (assoc 10 B)) pt2 (cdr (assoc 11 B)))
            (if (>(distance pt1 pick)(distance pick pt2))
             (setq pt pt1 pt1 pt2 pt2 pt)
            )
            (setq pt3 (list (car pt1)(cadr pt1)) pt4 (list (car pt2)(cadr pt2))
                      distold (distance pt3 pt4)
                      ang1 (angle pt2 pt1)
            )
            (princ "\nOld Distance=")
            (princ distold)
            (initget "Lengthen Shorten Total Elevation Percent Ratio")
            (if(= ¦¦global¦¦ nil)(setq ¦¦global¦¦ "Total"))
            (if(setq ¦¦notnil¦¦ (getkword (strcat " [Lengthen/Shorten/Total/Elevation/Percent/Ratio] <" ¦¦global¦¦ ">: ")))(setq ¦¦global¦¦ ¦¦notnil¦¦))
            (setvar "cmdecho" 0)
    
        (cond
          ((= ¦¦global¦¦ "Lengthen")
            (setq dist1 (+ distold (getreal "\nEnter Distance: "))
                      z1 (+(caddr pt2)(*(/ dist1 distold)(-(caddr pt1)(caddr pt2))))
            )
          ); Lengthen
          ((= ¦¦global¦¦ "Shorten")
            (setq dist1 (- distold (getreal "\nEnter Distance: "))
                      z1 (+(caddr pt2)(*(/ dist1 distold)(-(caddr pt1)(caddr pt2))))
            )
          ); Shorten
          ((= ¦¦global¦¦ "Total")
            (setq dist1 (getreal "\nEnter New Length: ")
                      z1 (+(caddr pt2)(*(/ dist1 distold)(-(caddr pt1)(caddr pt2))))
            )
          ); Total
          ((= ¦¦global¦¦ "Elevation")
            (setq z1 (getreal "\nEnter Elevation to Trim/Extend: ")
                      dist1 (*(/ distold (-(caddr pt1)(caddr pt2)))(- z1 (caddr pt2)))
              )
          ); Elevation
          ((= ¦¦global¦¦ "Percent")
            (setq z1 (+(caddr pt2)(* distold(getreal "\nEnter Slope in %: ")0.01))
                      dist1 distold
            )
          ); Percent
          ((= ¦¦global¦¦ "Ratio")
            (setq z1 (+(caddr pt2)(/ distold(getreal "\nEnter Run/Rise: ")))
                      dist1 distold
            )
          ); Ratio
        ); cond
    
            (setq pt1 (polar pt2 ang1 dist1)
                      pt1 (list (car pt1)(cadr pt1) z1)
            )
            (if pt (setq pt pt1 pt1 pt2 pt2 pt))
            (setq B (subst(cons 10 pt1)(assoc 10 B) B)
                  B (subst(cons 11 pt2)(assoc 11 B) B)
            )
            (entmod B)
            (princ "\nOld Distance=")
            (princ distold)
            (princ ", New Distance=")
            (princ dist1)
          ); progn
        ); line
        ((or(eq etype "ARC")(eq etype "POLYLINE")(eq etype "LWPOLYLINE"))
          (progn
            (command "lengthen" pick)
          ); progn
        ); ARC, POLYLINE or LWPOLYLINE
      ); cond
      (vla-EndUndoMark ActDoc)
      (princ)
    )

Similar Threads

  1. leader EXTEND TO LINE,POLYLINE LISP
    By klcecity371697 in forum AutoLISP
    Replies: 4
    Last Post: 2013-01-31, 09:01 AM
  2. Newbie Q: Is there a two-line trim/extend?
    By buttonsrtoys in forum AutoCAD General
    Replies: 9
    Last Post: 2010-03-15, 12:10 PM
  3. Trim or extend line to line - dynamic block
    By janandraczko in forum Dynamic Blocks - Technical
    Replies: 4
    Last Post: 2009-03-02, 12:33 AM
  4. line of Natural Slope
    By chipie088 in forum Revit Architecture - General
    Replies: 0
    Last Post: 2008-03-19, 11:25 AM
  5. Extend Extension Line
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 1
    Last Post: 2006-07-15, 07:05 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •