Search the Community
Showing results for tags 'chaingage'.
-
Lisp Problem. Very new to Lisp 'Chainage Line'
dweafer posted a topic in AutoLISP, Visual LISP & DCL
Hi, I found this online and it works. But the out put is different to what the Engineer/Client is looking for. Chainage prints out at '100', '200' -----> '1100', '1200' etc. Im looking for Chainage to print out 'ch 0+100', ' ch 0+200' -----> 'ch 1+100', 'ch 1+200' Any help would be great even to point me in the wright direction on how to do this. I have attached the Lisp which works here. (defun c:CHAINTXT ( / ) (Chainage_text)) (defun Chainage_text (/) (vl-load-com) (setq ss (ssget) count 0 dist 100.0 offset 5 height 2.5 ) (repeat (sslength ss) (setq ent (ssname ss count) obj (vlax-ename->vla-object ent) chainage dist ) (while (and (setq point1 (vlax-curve-getPointAtDist obj chainage)) (setq point2 (vlax-curve-getPointAtDist obj (+ chainage 0.1))) ) (setq bearing (+ (angle point1 point2) (/ PI 2.0))) (entmake (append '((0 . "LINE") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (100 . "AcDbLine")) (list (cons 10 (polar point1 bearing offset))) (list (cons 11 (polar point1 (+ bearing PI) offset))) '((210 0.0 0.0 1.0)) ) ) (entmake (append '((0 . "TEXT") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (100 . "AcDbText")) (list (cons 10 (polar point1 (+ bearing PI) (* offset 2.0)))) (list (cons 40 height)) (list (cons 1 (rtos chainage 2 3))) (list (cons 50 (+ bearing PI))) '((41 . 1.0) (51 . 0.0) (7 . "Standard") (71 . 0) (72 . 0) (11 0.0 0.0 0.0) (210 0.0 0.0 1.0) (100 . "AcDbText") (73 . 0)) ) ) (setq chainage (+ chainage dist)) ) (setq count (1+ count)) ) )- 17 replies