- 积分
- 6330
- 明经币
- 个
- 注册时间
- 2020-8-22
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2022-11-24 12:25:03
|
显示全部楼层
(defun c:FR (/ ss pts i ee :ST:SS-Boundingbox :ST:SS->List :ST:SS->ListVla LM:ssget os ov)
(setq
os '(PeditAccept cmdecho)
ov (mapcar 'getvar os)
)
(mapcar 'setvar os '(1 0))
(defun LM:ssget ( msg arg / sel )
(princ msg)
(setvar 'nomutt 1)
(setq sel (vl-catch-all-apply 'ssget arg))
(setvar 'nomutt 0)
(if (not (vl-catch-all-error-p sel)) sel)
)
;Return list ename from ssget
(defun :ST:SS->List(ss / n e l)
(setq n (sslength ss))
(while (setq e (ssname ss (setq n (1- n))))
(setq l (cons e l))
)
)
;Return list vla Object from s
(defun :ST:SS->ListVla(s)(mapcar 'vlax-ename->vla-object (:ST:SS->List s)))
(defun :ST:SS-Boundingbox ( lst / llp ls1 ls2 urp )
(foreach obj lst
(vla-getboundingbox obj 'llp 'urp)
(setq ls1 (cons (vlax-safearray->list llp) ls1)
ls2 (cons (vlax-safearray->list urp) ls2)
)
)
(mapcar '(lambda ( a b ) (apply 'mapcar (cons a b))) '(min max) (list ls1 ls2))
)
(or *newrad* (setq *newrad* 1))
(setq *newrad* (getdist (strcat "\nB\U+00E1n k\U+00EDnh fillet <" (rtos *newrad*) "> :")))
(setvar "FilletRad" *newrad*)
;(setq ss (ssget '(( 0 . "LINE,ARC,LWPOLYLINE"))))
(setq ss (LM:ssget "Select Line, Arc, Pline to fillet :" (list '(( 0 . "LINE,ARC,LWPOLYLINE")))))
(setq pts (:ST:SS-Boundingbox (:ST:SS->ListVla ss ))) ; ET func
(command "Pedit" "M" ss "" "J" "" "")
(setq ss (ssget "C" (car pts) (cadr pts) '(( 0 . "LWPOLYLINE")))
i 0
)
(while (setq ee (ssname ss i))
(command "Fillet" "P" ee)
(setq i (1+ i))
)
(mapcar 'setvar os ov)
(princ)
) |
评分
-
查看全部评分
|