entmake创建标注的一点小疑问
大家好,如何将entmake创建垂直标注的文字方向转换成和用command命令创建标注的文字方向调成一致呢(defun c:test()
(setvar "cmdecho" 0) ;关闭普通命令提示信息
(setvar "osmode" 0);关闭对象捕捉状态
(setq pt1(getpoint "请输入插入的位置:")
d1 500
d2 400
d3 3000
d4 1.5)
(setq p1 (list (car pt1) (+ (cadr pt1) 148.5))
p2 (list (car pt1) (+ (cadr p1) (- d1 (* d4 2))))
p3 (list (car pt1) (+ (cadr p2) (- d2 (* d4 2) 148.5)))
p4 (list (+ (car pt1) d3) (cadr p3))
p5 (list (car p4) (cadr p2))
p6 (list (car p4) (cadr p1))
p7 (list (car p4) (cadr pt1)))
(command "line" pt1 p1 p2 p3 p4 p5 p6 p7 "c")
(entmake (list '(0 . "DIMENSION") '(100 . "AcDbEntity") '(100 . "AcDbDimension") (cons 10 (list (+ (car p1) -50) (+ (cadr p1) 50)) ) '(70 . 32) '(1 . "")'(100 . "AcDbAlignedDimension") (cons 13 p1) (cons 14 pt1) '(50 . 1.5708) '(100 . "AcDbRotatedDimension")))
(command "dimlinear" p1 p2 "@-50,50")
(command "dimlinear" p2 p3 "@-50,50")
(setvar "osmode" 16383);打开对象捕捉状态
(command "._undo" "_end")
(princ) ;静默退出
)<img src="http://bbs.mjtd.com/forum.php?mod=image&aid=133049&size=300x300&key=daa4a3325d67f2d4&nocache=yes&type=fixnone" border="0" aid="attachimg_133049" alt="">
(defun c:NM(/ d1 d2 d3 d4 dwpt mk-line p1 p2 p3 p4 p5 p6 p7 pt1)
;; [函数名称]:MK-line
;; [功 能]:列表数据绘制直线
;; [参 数]: 点列表
;; [示 意]: (MK-line LST)
(defun MK-line (S / m-line)
(defun M-line (p1 p2)
(entmakex (list '(0 . "line") (cons 10 p1) (cons 11 p2)))
)
(mapcar
(function
(lambda(p1 p2)
(M-line p1 p2)
)
)
S (cdr s)
)
(M-line (car s) (last s))
)
(setvar "cmdecho" 0) ;关闭普通命令提示信息
(setvar "osmode" 0);关闭对象捕捉状态
(setq pt1(getpoint "请输入插入的位置:")
d1 500
d2 400
d3 3000
d4 1.5)
(setq p1 (list (car pt1) (+ (cadr pt1) 148.5))
p2 (list (car pt1) (+ (cadr p1) (- d1 (* d4 2))))
p3 (list (car pt1) (+ (cadr p2) (- d2 (* d4 2) 148.5)))
p4 (list (+ (car pt1) d3) (cadr p3))
p5 (list (car p4) (cadr p2))
p6 (list (car p4) (cadr p1))
p7 (list (car p4) (cadr pt1)))
(MK-line (list pt1 p1 p2 p3 p4 p5 p6 p7 ))
(setq dwpt(list (+ (car p1) -50) (+ (cadr p1) 50)))
(entmake (list '(0 . "DIMENSION") '(100 . "AcDbEntity") '(100 . "AcDbDimension") (cons 10 dwpt ) '(70 . 32) '(1 . "")'(100 . "AcDbAlignedDimension") (cons 13 p1) (cons 14 pt1) (cons 50 (* 0.5 pi)) '(100 . "AcDbRotatedDimension")))
(entmake (list '(0 . "DIMENSION") '(100 . "AcDbEntity") '(100 . "AcDbDimension") (cons 10 dwpt ) '(70 . 32) '(1 . "")'(100 . "AcDbAlignedDimension") (cons 13 p1) (cons 14 p2) (cons 50 (* 0.5 pi)) '(100 . "AcDbRotatedDimension")))
(entmake (list '(0 . "DIMENSION") '(100 . "AcDbEntity") '(100 . "AcDbDimension") (cons 10 dwpt ) '(70 . 32) '(1 . "")'(100 . "AcDbAlignedDimension") (cons 13 p2) (cons 14 p3) (cons 50 (* 0.5 pi)) '(100 . "AcDbRotatedDimension")))
(setvar "osmode" 16383);打开对象捕捉状态
(command "._undo" "_end")
(princ) ;静默退出
)
xj6019 发表于 2024-3-11 11:04
(defun c:NM(/ d1 d2 d3 d4 dwpt mk-line p1 p2 p3 p4 p5 p6 p7 pt1)
;; [函数名称]:MK-line
;; [功 ...
感谢,学艺不精,只会东拼西凑,现在知道(cons 50)是调整文字方向的了
页:
[1]