sivapathasunderam Posted December 7, 2016 Posted December 7, 2016 (edited) Dear all; Lisp to draw (as shown in Image) in autocad data collecting from text file as shown thanks Siva Edited December 7, 2016 by sivapathasunderam spelling error Quote
BIGAL Posted December 8, 2016 Posted December 8, 2016 You have 2 elements draw a grade line and draw a vertical curve, if a lisp existed then it would be pretty easy to do a type it in as 1st go. Reading the file is a lot more work. You would only need two functions. C:GRADE C:VC there is more that creeps into this like horizontal and vertical scale. Quote
hanhphuc Posted December 8, 2016 Posted December 8, 2016 You have 2 elements draw a grade line and draw a vertical curve.. ymg3 parabola lisps grade levels Quote
hanhphuc Posted December 9, 2016 Posted December 9, 2016 Here's simple concept to draw vertical alignment, but please bare in mind that the ACAD Arc geometry is NOT equal to the vertical alignment parabola. 1. User need to draw the alignment (polyline) base on xy coordinates only ie: VIP CH =X & VIP Level=Y format "xy.csv" 2. Invoke command VC 3. Pick the VC LWPolyline 4. Prompt user input for each VIP VCL (vertical curve length) Just for testing, no error handling & not for UCS etc.. (defun c:VC (/ o en g m ip vcl n c z l n) ;vertical curve example by hanhphuc 09.12.2016 (setq o (getvar 'osmode)) (setvar 'osmode 0) (if (and (setq en (car (entsel "\nPick Polyline.. "))) (= (cdr (assoc 0 (entget en))) "LWPOLYLINE") (setq l (mapcar 'cdr (vl-remove-if ''((x) (/= (car x) 10)) (entget en)))) (>= (setq c (length l)) 3) ) (progn (setq vcl (while (not vcl) (setq n 0) (repeat c (if (progn (initget 7) (setq a (getdist (strcat "\nEnter #" (itoa (setq n (1+ n))) " VCL: "))) ) (setq vcl (cons a vcl)) ) ) ) l (vl-sort l ''((a b) (<= (car a) (car b)))) g (mapcar ''((x y) (/ 1. (apply '/ (mapcar ''((a b) (if (zerop(setq z(- b a)))(+ z 1e-9)z)) x y)))) l (cdr l)) m (mapcar ''((a b c) (list (car a) (+ (cadr a) (* (* b 100.) (/ c 800.))))) (setq ip (cdr (vl-remove (last l) l))) (mapcar '- (cdr g) g) vcl ) ) (mapcar '(lambda (a b c) (vl-cmdf "arc" a b c)) (mapcar ''((a b c) (list (- (car a) b) (- (cadr a) (* c b)))) ip (mapcar ''((x) (/ x 2.)) vcl) g ) m (mapcar ''((a b c) (list (+ (car a) b) (- (cadr a) (* (- c) b)))) ip (mapcar ''((x) (/ x 2.)) vcl) (cdr g) ) ) ) ) (if o (setvar 'osmode o) ) (princ) ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.