本帖最后由 test2 于 2022-2-9 22:09 编辑
我也来试试
- ;;*** a05==修剪标注界线--v2 ----lxx.2002
- ;;
- ;; | p11 |
- ;; - ------ p10 -
- ;; | |
- ;; p13 p14
-
- (princ "\a05==修剪标注界线--v2 ----lxx.2002\n")
- ;;;
- (defun c:a05 ( / pt1 pt2 ss i ent entl p10 p13 p14 ptt np14 np13)
- (princ "\命令a05==修剪标注界线--v2 ----lxx.2002")
- (command "_.undo" "be" ^c )
- ;;;
- (defun *error* (msg) (print msg)(command "_.undo" "e" ^c)(setq *error* nil))
- ;;;
- (setq pt1 (getpoint "\n请指定修剪界线 ,起点:")
- pt2 (getpoint pt1 "\n终点:")
- ss (ssget "f" (list pt1 pt2) '((0 . "DIMENSION")) )
- pt1 (trans pt1 1 0)
- pt2 (trans pt2 1 0)
- i 0
- )
- (repeat (sslength ss)
- (setq ent (ssname ss i)
- entl (entget ent)
- p10 (cdr (assoc 10 entl))
- p13 (cdr (assoc 13 entl))
- p14 (cdr (assoc 14 entl))
- ;;ptt (cdr (assoc 11 entl))
- i (1+ i)
- pt1 (polar pt1 (angle pt1 pt2) (/ (distance pt1 pt2) 2) )
- pt2 (polar pt1 (+ (/ PI 2) (angle p10 p14)) 100)
- np14 (inters pt1 pt2 p14 p10 nil)
- )
- (if (not(member '(100 . "AcDbRotatedDimension") entl))
- (setq np13 (polar np14 (angle p14 p13) (distance p14 p13)))
- (setq np13 (inters pt1 pt2 p13 (polar p13 (angle p14 p10) 100) nil))
- )
- (setq entl (subst (cons 13 np13) (assoc 13 entl) entl)
- entl (subst (cons 14 np14) (assoc 14 entl) entl)
- )
- (entmod entl)
- );end repeat
- (command "_.undo" "e" ^c)
- (setq *error* nil)
- (princ)
- )
|