+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Forum Newbie
    Using
    AutoCAD 2007
    Join Date
    Feb 2007
    Posts
    7

    Default Automatic Extraction of Elevation Properties of Points on a Line

    Registered forum members do not see this ad.

    Please can anyone assist in locating a lisp program for Automatic Extraction of Elevation Properties of Points on a Line. I need this because, I need to use the elevation of points at specific intervals on a line to draw the longitudinal profile of the line.
    Thank you.

    Skipo

  2. #2
    Super Moderator fuccaro's Avatar
    Discipline
    Mechanical
    fuccaro's Discipline Details
    Occupation
    Mechanical eng.
    Discipline
    Mechanical
    Using
    AutoCAD 2006
    Join Date
    Nov 2002
    Location
    Romania, Marosvasarhely
    Posts
    3,567

    Default

    Using some math.
    If a line has the ends at elevations Z1 and Z2 and you wish to calculate say 15 intermediate points:
    DZ=(Z2-Z1)/15
    Now the 3rd intermediate point will have the elevation Z1+3*DZ
    The 9th point will be at Z1+9*DZ
    and so on
    It's nice to be nice, but sometimes is nicer to be evil!
    Tip: Please do not PM or email me with CAD questions - use the forums, you'll get an answer sooner.

  3. #3
    Super Moderator fuccaro's Avatar
    Discipline
    Mechanical
    fuccaro's Discipline Details
    Occupation
    Mechanical eng.
    Discipline
    Mechanical
    Using
    AutoCAD 2006
    Join Date
    Nov 2002
    Location
    Romania, Marosvasarhely
    Posts
    3,567

    Default

    I just wrote a short Lisp for you:
    Code:
    ;Divides a line in equal segments and write the WCS elevation for each division
    ; Fuccaro Miklos   March 2008
    ;-------------------------------------------------------------------------------
    (defun c:elevations( / l ll p1 p2 p n i cont)
      (defun blmaker()
        (if (not (tblsearch "BLOCK" "POINTMARKER"))
          (progn
     (entmake '((0 . "BLOCK")(2 . "POINTMARKER")(70 . 2)(10 0 0 0)))
     (entmake '((0 . "POINT")(10 0 0 0)))
     (entmake '((0 . "ATTDEF")(10 0 0)(1 . "f")(2 . "fuccaro")(3 . "miklos")
             (40 . 3.5)(41 . 1)(70 . 4)(72 . 2)))
     (entmake '((0 . "ENDBLK")))
     )
          )
        )
      (defun blins (poz)
        (entmake (list '(0 . "INSERT") '(66 . 1) '(2 . "POINTMARKER") (cons 10 poz)))
        (entmake (list (cons 0 "ATTRIB")
         (cons 10 poz)
         (cons 11 poz)
         (cons 70 8)
         (cons 72 2)
         (cons 40 3.5)
         (cons 1 (rtos (caddr poz)))
         (cons 2 "fuccaro")
         )
          )
        (entmake '((0 . "SEQEND")))
        )
         
      (setq cont t)
      (while cont
        (setq l (entsel "line?"))
        (if l (setq ll (entget (car l))))
        (setq cont (not (eq "LINE" (cdr (assoc 0 ll)))))
        )
      (setq p1 (cdr (assoc 10 ll)) p2 (cdr (assoc 11 ll)))
      (setq n (getint "divisions?"))
      (blmaker)
      (setq i 0)
      (repeat (1+ n)
        (setq p (list
           (+ (car p1) (/ (* i (- (car p2) (car p1))) n))
           (+ (cadr p1) (/ (* i (- (cadr p2) (cadr p1)))n))
           (+ (caddr p1) (/ (* i (- (caddr p2) (caddr p1)))n))
           )
       )
        (blins p)
        (setq i (1+ i))
        )
      (princ)
      )
    It's nice to be nice, but sometimes is nicer to be evil!
    Tip: Please do not PM or email me with CAD questions - use the forums, you'll get an answer sooner.

  4. #4
    Super Member rustysilo's Avatar
    Computer Details
    rustysilo's Computer Details
    Operating System:
    WinXP
    Discipline
    Civil
    rustysilo's Discipline Details
    Occupation
    Senior CAD Draftsman
    Discipline
    Civil
    Using
    Civil 3D 2008
    Join Date
    Jul 2007
    Location
    Jacksonville, FL - USA
    Posts
    1,458

    Default

    Registered forum members do not see this ad.

    Civil 3D will do this for you on a feature line. Otherwise use fuccaro's script.
    "Constantly choosing the lesser of two evils is still choosing evil." ~ Jerry Garcia
    flickr |
    work | blog | creed
    rustysilo's tips & tutorials

Similar Threads

  1. Automatic Line And Curve Labeling
    By ff7734 in forum AutoCAD Drawing Management & Output
    Replies: 5
    Last Post: 18th Oct 2009, 06:40 pm
  2. Line data extraction in AutoCAD 2005
    By rev.beernan in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 2
    Last Post: 15th Feb 2008, 04:20 pm
  3. Attribute Extraction, fully automatic
    By Kollargoll in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 24th Sep 2007, 10:42 am
  4. add vertex z or elevation to points
    By gvlisnas in forum AutoLISP, Visual LISP & DCL
    Replies: 8
    Last Post: 4th Aug 2007, 11:14 pm
  5. AUTOMATIC BREAK/TRIM A LINE WHEN INSERTING A SYMBOL
    By Frederik in forum AutoLISP, Visual LISP & DCL
    Replies: 2
    Last Post: 19th Sep 2005, 08:52 am

Bookmarks

Posting Permissions

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