快速拼接
- (defun c:test (/ ss dxf10 elev cnt *error*)
- (defun *error* (msg)
- (if (not
- (member msg '("Function cancelled" "quit / exit abort"))
- )
- (princ (strcat "\nError: " msg))
- )
- (princ)
- )
- (alert "Select Points to Add Elevation Text: ")
- (if (setq ss (ssget (list(cons 0 "POINT"))))
-
- (progn
- (setq cnt 0)
- (repeat (sslength ss)
- (setq dxf10 (cdr (assoc 10 (entget (ssname ss cnt))))
- elev (caddr dxf10)
- cnt (+ cnt 1)
- )
- (command "Text" dxf10 "" "" (rtos elev 2 3))
- ;;; Now you just need to add in the text code, it will be based on what offset from the point you
- ;;; want
- )
- )
- )
- (princ)
- )
- ;; ssget - Lee Mac
- ;; A wrapper for the ssget function to permit the use of a custom selection prompt
- ;; msg - [str] selection prompt
- ;; arg - [lst] list of ssget arguments
- (defun LM:ssget (msg arg / sel)
- (princ msg)
- (setvar 'nomutt 1)
- (setq sel (vl-catch-all-apply 'ssget arg))
- (setvar 'nomutt 0)
- (if (not (vl-catch-all-error-p sel))
- sel
- )
- )
|