求输入TT,画线,线宽图纸缩放时显示的宽度不变,类似BQCZ这样的外框的线
求输入TT,画线,线宽图纸缩放时显示的宽度不变,类似BQCZ这样的外框的线,线的图层名为你好123(defun c:tt()
(setq lst '() )
(setq pt1 (getpoint" 起点:"))
(setq x1 (car pt1))
(setq y1 (cadr pt1))
(setq lsta (list x1 y1) )
(setq lst(conslsta lst) )
(while (setq pt (getpoint pt1 " 下一点:"))
(setq x (car pt))
(setq y (cadr pt))
(setq lst1 (list x y) )
(setq lst(conslst1 lst) )
(command "line" pt1 pt "")
(setq pt1 pt)
)
(entmake (append (list '(0 . "LWPOLYLINE")
'(100 . "AcDbEntity")
'(8 . "你好123")
'(370 . 90)
'(100 . "AcDbPolyline")
(cons 90 (length lst))
)
(mapcar '(lambda (pt)(cons 10 pt)) lst )
)
)
(princ)
)
(princ "\n程序加载完成")
(princ "\n")
有画线的过程(defun c:tt (/ pt set-dxf ty)
(defun set-dxf (ename code val / ent)
(setq ent (entget ename))
(if (and (listp code) (listp val))
(mapcar '(lambda (x y) (set-dxf ename x y)) code val)
(progn
(if (assoc code ent)
(setq ent (subst (cons code val) (assoc code ent) ent))
(setq ent (append ent (list (cons code val))))
)
(entmod ent)
(entupd ename)
)
)
ename
)
(setq pt(getpoint"\n下一点:"))
(command "pline" pt)
(while (NOT (ZEROP (GETVAR "cmdactive"))) (command PAUSE))
(setq ty (entlast))
(set-dxf ty '(8 370) '("你好123" 90))
(princ)
) 664571221 发表于 2024-1-29 18:22
好像不能用
可以用。根据楼上的改了一下。
(defun c:tt(/ lts pt)
(command "UNDO" "be")
(setq lst '())
(setq pt (getpoint "指定起点:"))
(setq lst (cons pt lst))
(while (setq pt (getpoint pt " 下一点:"))
(setq lst (cons pt lst))
)
(entmake (append (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity")'(8 . "你好123") '(100 . "AcDbPolyline") (cons 90 (length lst))) (mapcar '(lambda (pt)(cons 10 pt)) lst )))
(command "UNDO" "e")
)
(princ "\n程序加载完成,命令TT")
(princ) ;爱编程的小和尚
(defun c:tt()
(vl-load-com)
(setq lst '())
(setq pt ' (0 0))
(while (setq pt (getpoint pt " 下一点:"))
(setq x (car pt))
(setq y (cadr pt))
(setq lst1 (list x y) )
(setq lst(conslst1 lst) )
)
(entmake (append (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity")'(8 . "你好123")'(370 . 90)'(100 . "AcDbPolyline") (cons 90 (length lst))) (mapcar '(lambda (pt)(cons 10 pt)) lst )) )
(princ)
)
(princ "\n程序加载完成")
(princ "\n") 听高人说,要多用ENTMAKE,听人劝,吃饱饭。vegetaria 弥勒 发表于 2024-1-29 17:52
;爱编程的小和尚
(defun c:tt()
(vl-load-com)
谢谢小和尚 弥勒 发表于 2024-1-29 17:52
;爱编程的小和尚
(defun c:tt()
(vl-load-com)
好像不能用 线宽图纸缩放时显示的宽度不变 是不是图越小时就感觉线宽越大那样 而不是全局宽度? 664571221 发表于 2024-1-29 18:21
谢谢小和尚
阿弥陀佛,能用,不太好用,但满足要求,TT 画粗线,图层。 弥勒 发表于 2024-1-29 21:31
阿弥陀佛,能用,不太好用,但满足要求,TT 画粗线,图层。
好像可以用,就是不显示画线的过程,还有一直显示0.0点那个虚线