本帖最后由 cq4920 于 2023-2-24 19:18 编辑
- ;;平面开门洞
- (defun c:ttr (/ os p1 p2 ss layername i n ptla obj ptl ent )
- (setvar "cmdecho" 0)
- (setq os (getvar "osmode"))
- (setq p1 (getpoint"\n 指定双线外侧第一点"))
- (setq p2 (getpoint p1 "\n 指定双线另一侧的点"))
- (setq
- ss (ssget "_f" (list p1 p2))
- layername (cdr (assoc 8 (entget (ssname ss 0)))))
- (entmake (list '(0 . "LINE") (cons 10 p1) (cons 11 p2)))
- (setq ent (entlast))
- (setq i 0 n (sslength ss) ptla '())
- (repeat n
- (setq obj (ssname ss i))
- (setq ptl (HH:TwoEntsInters ent obj 0))
- (setq ptla (append ptla ptl))
- (setq i (1+ i))
- )
- (setq ptla (MC-pt ptla))
- (COMMAND "_.erase" ENT "")
- (command "_.BOUNDARY" (mc:md (car ptla) (cadr ptla)) "")
- (mc:ggtc (last_ent ent) layername)
- (setvar "osmode" 0)
- (vl-cmdf "trim" "" "f" p1 p2 "" "")
- (lj (ssget "x" (list (cons 0 "line,LWPOLYLINE,arc") (cons 8 layername))) )
- (command "._undo" "end")
- (setvar "osmode" os)
- (princ)
- )
如果是这样的问题那我其他的帖子可以看一看!!
|