
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
Please take a look at this code (I have made the text red on the line that has an error, and I don't know why?):
I am trying to extract the vertices of a polyline.
(defun c:r15 ()
(setq e (entget (car (entsel "Select polyline to analyse: "))))
(setq p1 (getpoint "Click where you want the table: "))
(setq p2 p1)
(setq tz (getreal "Enter text height: "))
(setq ct 0)
(setq lnth (length e))
(setq tbly 0)
(setq n 1)
(repeat lnth
(setq ct (+ 1 ct))
(setq tx (nth ct e))
(setq ts (car tx))
(if (= ts 10)
(progn
(setq crd (cdr tx))
(set (read (strcat "pt" (itoa n) "x")) (car crd))
(set (read (strcat "pt" (itoa n) "y")) (cadr crd))
(set (read (strcat "pt" (itoa n) "xs")) (rtos (strcat "pt" (itoa n) "x") 2 3))
(set (read (strcat "pt" (itoa n) "ys")) (rtos (strcat "pt" (itoa n) "y") 2 3))
(command "text" p2 tz 0 (read (strcat "pt" (itoa n) "xs")))
(setq tblx (polar p2 0 (* 10 tz)))
(command "text" tblx tz 0 (read (strcat "pt" (itoa n) "ys")))
(setq n (+ 1 n))
(setq tbly (+ (* tz 1.5) tbly))
(setq p2 (polar p1 (dtr 270) tbly))
)
)
)
)
(defun dtr (deg)(* pi (/ deg 180.0)))
Solved! Go to Solution.