Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Need A Lisp For Annotation of PC , PT , PI etc on Road Centerline

  1. #1
    Member
    Join Date
    2016-04
    Posts
    34
    Login to Give a bone
    0

    Default Need A Lisp For Annotation of PC , PT , PI etc on Road Centerline

    Hi,
    I'm working on a road plan & profile, i need a lisp routine to annotate (PC , PT , PI etc) vertically with a line and a small circle on centerline. If anyone has that lisp, Kindly help me out.
    ThanksPlan & Profile.png
    Last edited by Sameer Ahmed; 2019-11-19 at 05:38 AM.

  2. #2
    I could stop if I wanted to devitg.89838's Avatar
    Join Date
    2005-06
    Location
    CORDOBA-ARGENTINA
    Posts
    257
    Login to Give a bone
    0

    Default Re: Need A Lisp For Annotation of PC , PT , PI etc on Road Centerline

    Please upload a real-before.dwg and a real-after.dwg

  3. #3
    I could stop if I wanted to
    Join Date
    2003-07
    Posts
    347
    Login to Give a bone
    0

    Default Re: Need A Lisp For Annotation of PC , PT , PI etc on Road Centerline

    The answer is in CIV3d or other 3rd party Civil software, but sounds like you do not have these.

    devitg Its easy for plan harder for a profile as ver & hor scales, chainages, multi sheets all come into play.

    Re chainages google just that Chainage.lsp a few versions.

  4. #4
    Member
    Join Date
    2016-04
    Posts
    34
    Login to Give a bone
    0

    Default Re: Need A Lisp For Annotation of PC , PT , PI etc on Road Centerline

    i already have chainage lisp, but it doesn't add PC , PT , PI or any other data related. Here is the lisp routine.


    (defun make_blk_measure ( / )
    (if (not (tblsearch "STYLE" "$BLK_MEAS"))
    (entmake '((0 . "STYLE")
    (5 . "40")
    (100 . "AcDbSymbolTableRecord")
    (100 . "AcDbTextStyleTableRecord")
    (2 . "$BLK_MEAS")
    (70 . 0)
    (40 . 0.0)
    (41 . 0.7)
    (50 . 0.0)
    (71 . 0)
    (42 . 0.1)
    (3 . "ARIAL.TTF")
    (4 . "")
    )
    )
    )
    (if (not (tblsearch "BLOCK" "BLK_MEASURE_CURVE"))
    (progn
    (entmake
    '((0 . "BLOCK") (8 . "0") (2 . "BLK_MEASURE_CURVE") (70 . 2) (4 . "") (8 . "0") (62 . 0) (6 . "ByBlock") (370 . -2) (10 0.0 0.0 0.0))
    )
    (entmake
    (append
    '((0 . "LINE") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (62 . 0) (6 . "ByBlock") (370 . -2) (100 . "AcDbLine"))
    (list (list 10 0.0 (- (getvar "TEXTSIZE")) 0.0))
    (list (list 11 0.0 (getvar "TEXTSIZE") 0.0))
    '((210 0.0 0.0 1.0))
    )
    )
    (entmake
    '(
    (0 . "ATTDEF")
    (100 . "AcDbEntity")
    (67 . 0)
    (410 . "Model")
    (8 . "0")
    (62 . 0)
    (6 . "ByBlock")
    (370 . -2)
    (100 . "AcDbText")
    (10 0.0 0.0 0.0)
    (40 . 1.0)
    (1 . "0.0")
    (50 . 1.570796326794896)
    (41 . 0.7)
    (51 . 0.0)
    (7 . "$BLK_MEAS")
    (71 .
    (72 . 1)
    (11 1.0 0.0 0.0)
    (210 0.0 0.0 1.0)
    (100 . "AcDbAttributeDefinition")
    (3 . "measure")
    (2 . "VALUE_MEASURE")
    (70 . 0)
    (73 . 0)
    (74 . 1)
    )
    )
    (entmake '((0 . "ENDBLK") (8 . "0") (8 . "0") (62 . 0) (6 . "ByBlock") (370 . -2)))
    )
    )

    (if (not (tblsearch "BLOCK" "BLK_TICK_CURVE"))
    (progn
    (entmake
    '((0 . "BLOCK") (8 . "0") (2 . "BLK_TICK_CURVE") (70 . 2) (4 . "") (8 . "0") (62 . 0) (6 . "ByBlock") (370 . -2) (10 0.0 0.0 0.0))
    )
    (entmake
    (append
    '((0 . "LINE") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (62 . 0) (6 . "ByBlock") (370 . -2) (100 . "AcDbLine"))
    (list (list 10 0.0 (* 0.5 (- (getvar "TEXTSIZE"))) 0.0))
    (list (list 11 0.0 (* 0.5 (getvar "TEXTSIZE")) 0.0))
    '((210 0.0 0.0 1.0))
    )
    )
    (entmake '((0 . "ENDBLK") (8 . "0") (8 . "0") (62 . 0) (6 . "ByBlock") (370 . -2)))
    )
    )
    )
    (defun z_dir (p1 p2 / )
    (trans
    '(0.0 1.0 0.0)
    (mapcar
    '(lambda (k)
    (/ k
    (sqrt
    (apply '+
    (mapcar
    '(lambda (x) (* x x))
    (mapcar '- p2 p1)
    )
    )
    )
    )
    )
    (mapcar '- p2 p1)
    )
    0
    )
    )
    (defun c:chainage ( / js dxf_obj obj_vlax pt_start pt_end total_dist partial_dist ori_dist tmp_var lst_pt increment_dist sv_luprec sv_dzin ang dxf_210 p_fix mantiss count)
    (princ "\nChoose a curvilinear object to be measured: ")
    (while
    (not
    (setq js
    (ssget "_+.:E:S"
    (list
    (cons 0 "*POLYLINE,LINE,ARC,CIRCLE,ELLIPSE,SPLINE")
    (cons 67 (if (eq (getvar "CVPORT") 2) 0 1))
    (cons 410 (if (eq (getvar "CVPORT") 2) "Model" (getvar "CTAB")))
    (cons -4 "<NOT")
    (cons -4 "&") (cons 70 112)
    (cons -4 "NOT>")
    )
    )
    )
    )
    (princ "\nIt is not a valid curvilinear object for this function!")
    )
    (vl-load-com)
    (setq
    dxf_obj (entget (ssname js 0))
    obj_vlax (vlax-ename->vla-object (ssname js 0))
    pt_start (vlax-curve-getStartPoint obj_vlax)
    pt_end (vlax-curve-getEndPoint obj_vlax)
    total_dist (vlax-curve-getDistAtParam obj_vlax (vlax-curve-getEndParam obj_vlax))
    partial_dist (getreal "\nTo establish the chainage with a distance of? <1000.0>: ")
    )
    (if (not partial_dist) (setq partial_dist 500.0) (setq partial_dist (* 0.5 partial_dist)))
    (setq ori_dist (getreal "\nStart chainage at (give décimal value) 0+000 <0.0>: "))
    (if (not ori_dist) (setq ori_dist 0.0))
    (cond
    ((> total_dist partial_dist)
    (initget 6)
    (setq tmp_var (getdist (strcat "\nEnter a new value for pour TEXTSIZE <" (rtos (getvar "TEXTSIZE")) ">: ")))
    (if (not tmp_var) (setq tmp_var (getvar "TEXTSIZE")))
    (setvar "TEXTSIZE" tmp_var)
    (make_blk_measure)
    (setq
    sv_luprec (getvar "LUPREC")
    sv_dzin (getvar "DIMZIN")
    )
    (setvar "DIMZIN" 0)
    (setq count 1)
    (setq increment_dist (rem (- 1000.0 (atoi (substr (rtos ori_dist 2 3) (+ 2 (vl-string-search "." (rtos ori_dist 2 3)))))) partial_dist))
    (setvar "CMDECHO" 1)
    (setvar "LUPREC" 0)
    (while (< increment_dist total_dist)
    (setq
    lst_pt (cons (vlax-curve-getPointAtDist obj_vlax increment_dist) lst_pt)
    increment_dist (+ increment_dist partial_dist)
    )
    )
    (setq lst_pt (reverse (cons pt_end lst_pt)))
    (foreach n lst_pt
    (setq
    ang (angle '(0.0 0.0 0.0) (vlax-curve-getFirstDeriv obj_vlax (vlax-curve-getParamAtPoint obj_vlax n)))
    dxf_210 (z_dir n (polar n ang (* 0.1 partial_dist)))
    p_fix (atoi (rtos (/ (vlax-curve-getDistAtPoint obj_vlax n) 1000.0) 2 3))
    mantiss
    (+
    (-
    (vlax-curve-getDistAtPoint obj_vlax n)
    (* p_fix 1000.0)
    )
    (atoi (substr (rtos ori_dist 2 3) (+ 2 (vl-string-search "." (rtos ori_dist 2 3)))))
    )
    )
    (if (or (equal mantiss 1000.0 1E-3) (> mantiss 1000.0)) (setq p_fix (1+ p_fix) mantiss (- mantiss 1000)))
    (if (zerop (fix mantiss))
    (setq mantiss "000")
    (if (eq (strlen (itoa (fix (+ mantiss 0.1)))) 2)
    (setq mantiss (strcat "0" (rtos (fix (+ mantiss 0.001)) 2 0)))
    (setq mantiss (rtos mantiss 2 0))
    )
    )
    (cond
    ((zerop (rem (setq count (1+ count)) 2))
    (entmake
    (list
    (cons 0 "INSERT")
    (cons 100 "AcDbEntity")
    (assoc 67 dxf_obj)
    (assoc 410 dxf_obj)
    (cons 8 (getvar "CLAYER"))
    (cons 100 "AcDbBlockReference")
    (cons 66 1)
    (cons 2 "BLK_MEASURE_CURVE")
    (cons 10 (trans n 0 dxf_210))
    (cons 41 (* 0.1 partial_dist))
    (cons 42 (* 0.1 partial_dist))
    (cons 43 (* 0.1 partial_dist))
    (cons 50 ang)
    (cons 210 dxf_210)
    )
    )
    (entmake
    (list
    (cons 0 "ATTRIB")
    (cons 100 "AcDbEntity")
    (assoc 67 dxf_obj)
    (assoc 410 dxf_obj)
    (cons 8 (getvar "CLAYER"))
    (cons 100 "AcDbText")
    (cons 10 (trans '(0 0 0) 0 dxf_210))
    (cons 40 (getvar "TEXTSIZE"))
    (cons 1
    (strcat
    (itoa (+ p_fix (fix ori_dist)))
    "+"
    mantiss
    )
    )
    (cons 50 (+ (/ pi 2) ang))
    (cons 41 0.7)
    (cons 51 0.0)
    (cons 7 "$BLK_MEAS")
    (cons 71 0)
    (cons 72 1)
    (cons 11 (trans n 0 dxf_210))
    (cons 210 dxf_210)
    (cons 100 "AcDbAttribute")
    (cons 2 "VALUE_MEASURE")
    (cons 70 0)
    (cons 73 0)
    (cons 74 1)
    )
    )
    (entmake (list (cons 0 "SEQEND") (cons 8 (getvar "CLAYER")) (cons 62 0) (cons 6 "ByBlock") (cons 370 -2)))
    )
    (T
    (entmake
    (list
    (cons 0 "INSERT")
    (cons 100 "AcDbEntity")
    (assoc 67 dxf_obj)
    (assoc 410 dxf_obj)
    (cons 8 (getvar "CLAYER"))
    (cons 100 "AcDbBlockReference")
    (cons 2 "BLK_TICK_CURVE")
    (cons 10 (trans n 0 dxf_210))
    (cons 41 (* 0.1 partial_dist))
    (cons 42 (* 0.1 partial_dist))
    (cons 43 (* 0.1 partial_dist))
    (cons 50 ang)
    (cons 210 dxf_210)
    )
    )
    )
    )
    )
    (setvar "LUPREC" sv_luprec)
    (setvar "DIMZIN" sv_dzin)
    )
    (T (princ "\nThe length is too big for the object!"))
    )
    (prin1)
    )

  5. #5
    I could stop if I wanted to
    Join Date
    2003-07
    Posts
    347
    Login to Give a bone
    0

    Default Re: Need A Lisp For Annotation of PC , PT , PI etc on Road Centerline

    It comes down to deciding is that chainage point a change in direction point, so 1st make a list of vertices ie chainage and decide their labelling. Maybe put on opposite side of chainages as a separate routine. The screen shot is what you want its CIV3D.

    You need a second pass adding the vertices to your code ie getpointatdist chainage is a tangent point.

    Code:
    this would be better as a defun
    (entmake
    (list
    (cons 0 "INSERT")
    (cons 100 "AcDbEntity")
    (assoc 67 dxf_obj)
    (assoc 410 dxf_obj)
    (cons 8 (getvar "CLAYER"))
    (cons 100 "AcDbBlockReference")
    (cons 66 1)
    (cons 2 "BLK_MEASURE_CURVE")
    (cons 10 (trans n 0 dxf_210))
    (cons 41 (* 0.1 partial_dist))
    (cons 42 (* 0.1 partial_dist))
    (cons 43 (* 0.1 partial_dist))
    (cons 50 ang)
    (cons 210 dxf_210)
    )
    )
    Code:
    May be helpfull
    (setq plent (entsel "pick pline"))
    (if plent (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget (car plent))))))
    
    (vlax-curve-getDistAtPoint obj_vlax n)
    Attached Images Attached Images
    Last edited by BIG-AL; 2019-11-21 at 07:09 AM.

  6. #6
    Member
    Join Date
    2016-04
    Posts
    34
    Login to Give a bone
    0

    Default Re: Need A Lisp For Annotation of PC , PT , PI etc on Road Centerline

    BIG-AL , Please edit whole chainage.lsp, the one i have pasted here and share it on this forum , i really need the lisp and please make it like PC , PT & PI , i'm stucked, please help me out , i will be thankful to you for this act of kindness. Thanks

  7. #7
    100 Club
    Join Date
    2002-08
    Posts
    187
    Login to Give a bone
    0

    Default Re: Need A Lisp For Annotation of PC , PT , PI etc on Road Centerline

    Test it if can you help you!
    Attached Files Attached Files

  8. #8
    Member
    Join Date
    2016-04
    Posts
    34
    Login to Give a bone
    0

    Default Re: Need A Lisp For Annotation of PC , PT , PI etc on Road Centerline

    Bruno.Valsecchi , i appreciate your lisp routine , but kindly change it like , for example , curve first side , PC = 0+015 whatever it is , then PI = Chainage and then PT= Chainage whatever that is. Make it that way , and if possible make it to draw triangle for every PI where it intersects. I will be very thankful to you for this act of kindness. Thanks

  9. #9
    100 Club
    Join Date
    2002-08
    Posts
    187
    Login to Give a bone
    0

    Default Re: Need A Lisp For Annotation of PC , PT , PI etc on Road Centerline

    This version?
    Attached Files Attached Files

  10. #10
    Member
    Join Date
    2016-04
    Posts
    34
    Login to Give a bone
    0

    Default Re: Need A Lisp For Annotation of PC , PT , PI etc on Road Centerline

    Bruno.Valescchi , Wonderful Amazing , Thanks , but there is just one minor change needed, then it's perfect , could you please place the text of PI (point of intersection) over the centerline , not on Triangle , i mean just like PC & PT ,
    i need PI on the same line. Thanks

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 0
    Last Post: 2013-08-10, 10:46 AM
  2. Road output: Create Road Surface
    By DBill2508 in forum AutoCAD Civil 3D - Land Desktop Companion - General
    Replies: 0
    Last Post: 2009-09-10, 12:04 PM
  3. 8.1/E - Centerline symbol in dims to Centerline type lines - O
    By janunson in forum Revit Architecture - Wish List
    Replies: 0
    Last Post: 2006-02-01, 07:57 PM
  4. Need a centerline of stream
    By jim.dahl in forum AutoCAD Map 3D - General
    Replies: 10
    Last Post: 2005-08-10, 01:07 PM

Posting Permissions

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