Тема: Создание точек с высотой из окружностей и близлежащего текста
Лисп для создания точек с высотой из окружностей и близлежащего текста. Не вполне проверенный. Ногами не бить.
;| Created by Mikhael Burshtein 30/03/2008 The program for creation of elevated points from a circle and the nearby text. Restrictions: - the text decimal numbers should be separated with ( . ) instead of ( , ) |; (defun C:ent2elv () (setq ezosmode (getvar "osmode")) (setvar "osmode" 0) (command "_.undo" "begin") (setq sset (ssget '((0 . "CIRCLE")))) (setq sset_text (ssget "_X" '((0 . "TEXT")))) (setq step_point 0) (repeat (sslength sset) (setq ent (entget (ssname sset step_point))) (setq point (cdr (assoc 10 ent))) (setq _x (car point) _y (cadr point)) (setq step_text 0) (setq prev_len 1000000) (repeat (sslength sset_text) (setq ent1 (entget (ssname sset_text step_text))) (setq text_xy (cdr (assoc 10 ent1))) (setq t_x (car text_xy) t_y (cadr text_xy)) (setq len_text_point (sqrt (+ (* (- _x t_x) (- _x t_x)) (* (- _y t_y) (- _y t_y))))) (if (> prev_len len_text_point) (progn (setq prev_len len_text_point) (setq elevation (read (cdr (assoc 1 ent1)))) ; Z value extracted (if (= nil (numberp elevation)) (prompt "\nThat TEXT VALUE is not a NUMBER! Try again...") ) ) );;if (setq step_text (1+ step_text)) ) (command "_.POINT" (list _x _y (distof (rtos elevation)))) (setq step_point (1+ step_point)) ) ) (prompt "\nType ent2elv to run.") (princ)