基线标注
本帖最后由 yefei812678 于 2024-9-21 12:18 编辑基线标注 怎么修改为注释性标注,现在它标注的时候选择的标注是注释性的,标注出来不是注释性的,怎么修改为注释性的?
(defun c:jx (/ ang_dim angx angxx d dim1 dim2 dimlst n pt1 pt2 pt3 ptlst ss)
(if (not DD) (setq DD (getdist "\n输入基线间距:")) (setq DD (if (setq D (getdist (strcat "\n输入基线间距<" (rtos DD 2 2) ">:"))) D DD)))
(setq n 0 dimlst '() ss (ssget '((0 . "DIMENSION"))))
(repeat (sslength ss) (setq dimlst (cons (ssname ss n) dimlst) n (1+ n)));;选集 》表
(setq pt3 (polar (cdr (assoc 10 (entget (car dimlst)))) (angle (cdr (assoc 14 (entget (car dimlst)))) (cdr (assoc 10 (entget (car dimlst))))) DD))
;(if (= 1 (sslength ss))
(setq dim1 (ssname ss 0)ang_dim (angle (try-Pt-ToLine (cdr (assoc 10 (entget dim1))) (cdr (assoc 13 (entget dim1))) (polar (cdr (assoc 13 (entget dim1)))(angle (cdr (assoc 14 (entget dim1))) (cdr (assoc 10 (entget dim1)))) 30)) (cdr (assoc 10 (entget dim1)))))
(if (or (equal ang_dim (* 0.5 pi) 0.001) (equal ang_dim (* 1.5 pi) 0.001))
(progn
(setq dim1 (car (vl-sort dimlst '(lambda (a b) (< (cadr (cdr (assoc 11 (entget a)))) (cadr (cdr (assoc 11 (entget b)))))))) dim2 (last (vl-sort dimlst '(lambda (a b) (< (cadr (cdr (assoc 11 (entget a)))) (cadr(cdr (assoc 11 (entget b)))))))));最小-最大
(setq ptlst (list (cdr (assoc 10 (entget dim1))) (cdr (assoc 10 (entget dim2)))(try-Pt-ToLine (cdr (assoc 10 (entget dim1))) (cdr (assoc 13 (entget dim1))) (polar (cdr (assoc 13 (entget dim1))) (angle (cdr (assoc 14 (entget dim1))) (cdr (assoc 10 (entget dim1)))) 30)) (try-Pt-ToLine (cdr (assoc 10 (entget dim2))) (cdr (assoc 13 (entget dim2))) (polar (cdr (assoc 13 (entget dim2))) (angle (cdr (assoc 14 (entget dim2))) (cdr (assoc 10 (entget dim2)))) 30))))
(setq pt1 (car (vl-sort ptlst '(lambda (a b) (< (cadr a) (cadr b)))))pt2 (last (vl-sort ptlst '(lambda (a b) (< (cadr a) (cadr b))))));最小-最大
(entmake (list '(0 . "DIMENSION") '(100 . "AcDbEntity") '(100 . "AcDbDimension") (cons 10 pt3) '(70 . 0) '(1 . "") '(100 . "AcDbAlignedDimension") (cons 13 pt2) (cons 14 pt1) (cons 50(* 0.5 pi)) '(100 . "AcDbRotatedDimension")));竖直
;(command "DIMLINEAR" "non" pt1"non" pt2"non" (getpoint))
);progn1
(progn
(setq dim1 (car (vl-sort dimlst '(lambda (a b) (< (car (cdr (assoc 11 (entget a)))) (car (cdr (assoc 11 (entget b)))))))) dim2 (last (vl-sort dimlst '(lambda (a b) (< (car (cdr (assoc 11 (entget a)))) (car(cdr (assoc 11 (entget b)))))))));最小-最大
(setq ptlst (list (cdr (assoc 10 (entget dim1))) (cdr (assoc 10 (entget dim2)))(try-Pt-ToLine (cdr (assoc 10 (entget dim1))) (cdr (assoc 13 (entget dim1))) (polar (cdr (assoc 13 (entget dim1))) (angle (cdr (assoc 14 (entget dim1))) (cdr (assoc 10 (entget dim1)))) 30)) (try-Pt-ToLine (cdr (assoc 10 (entget dim2))) (cdr (assoc 13 (entget dim2))) (polar (cdr (assoc 13 (entget dim2))) (angle (cdr (assoc 14 (entget dim2))) (cdr (assoc 10 (entget dim2)))) 30))))
(setq pt1 (car (vl-sort ptlst '(lambda (a b) (< (car a) (car b)))))pt2 (last (vl-sort ptlst '(lambda (a b) (< (car a) (car b))))));最小-最大
(if (equal (angle pt1 pt2) 0 0.01)
(entmake (list '(0 . "DIMENSION") '(100 . "AcDbEntity") '(100 . "AcDbDimension") (cons 10 pt3) '(70 . 32) '(1 . "") '(100 . "AcDbAlignedDimension") (cons 13 pt1) (cons 14 pt2) '(50 . 0) '(100 . "AcDbRotatedDimension")));水平
(progn
(command "UCS" "z" "non" pt1 "non" pt2 )
(setq angx (angle pt1 pt2) angxx (atof (rtos angx 2 4)))
(entmake (list '(0 . "DIMENSION") '(100 . "AcDbEntity") '(100 . "AcDbDimension") (cons 10 pt3) '(70 . 32) '(1 . "") '(100 . "AcDbAlignedDimension") (cons 13 pt1) (cons 14 pt2) (cons 50 angxx)'(100 . "AcDbRotatedDimension")))
(command "UCS" "w") ;斜
)
);if
);progn2
);ifz
(princ)
)
;pt到p1、p2垂点
(defun try-Pt-ToLine(pt p1 p2 ) (intersp1 p2 pt (polar pt(+ (* 0.5 pi) (angle p1 p2) )10) nil))
使用entmake创建标注样式时不是注释性的 没有大佬给看看嘛》 好厉害的感觉
页:
[1]