是否能写出这样的代码?
我想批量在鼠标框选的每个直线段的中点插入块,块的方向要顺着直线方向作自动调整,求这样的代码,谢谢!(defun mb ()
(if
(setq blk (ui:select
"block name "
(vl-remove-if
'(lambda (x) (= "*" (substr x 1 1)))
(tbl:list "block")
)))
(progn
(setq lines (pickset:to-list (ssget '((0 . "line")))))
(foreach line lines
(block:insert
blk
""
(line:mid line)
(apply 'angle (curve:get-points line))
1
)))))
http://atlisp.cn/static/videos/blk-in-line-mid.mp4 块儿的方向 具体是指的啥? (DEFUN C:TT (/ e1 ss i ent p10 p11 i)
(defun MID (po1 po2)
(setq po (MAPCAR '(lambda (X Y) (* (+ X Y) 0.5)) po1 po2))
)
(SETQ E1 (CDR (ASSOC 2 (ENTGET (CAR (ENTSEL "选择需要插入的块"))))
SS (SSGET '((0 . "LINE")))
I 0
)
)
(IF (AND SS E1)
(REPEAT (SSLENGTH SS)
(SETQ ENT (SSNAME SS I)
P10 (CDR (ASSOC 10 (ENTGET ENT)))
P11 (CDR (ASSOC 11 (ENTGET ENT)))
P1 (MID P10 P11)
)
(entmake (list '(0 . "INSERT")
(cons 2 E1)
(cons 10 p1)
(cons 50 (ANGLE P10 P11))
)
)
(SETQ I (1+ I))
)
)
)
vitalgg 发表于 2023-3-15 17:14
6666666666 vitalgg 发表于 2023-3-15 17:14
Error: undefined function - TBL:LIST michaelbomo 发表于 2023-8-17 12:32
Error: undefined function - TBLIST
视频右下角网址安装相关的 函数库。
页:
[1]