0% found this document useful (0 votes)
8 views1 page

Chainage Text - Chaintxt

Uploaded by

bravomikeparle
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views1 page

Chainage Text - Chaintxt

Uploaded by

bravomikeparle
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

(defun c:CHAINTXT ( / ) (Chainage_text))

(defun Chainage_text (/)


(vl-load-com)
(setq ss (ssget))
(setq dist 100.0)
(setq dist(getreal (strcat "\n Chainage Distance<" (rtos dist 2 2) ">" )))
(if (= dist nil) (setq dist 100))
(setq count 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))
)
)

You might also like