本帖最后由 x_s_s_1 于 2024-1-18 08:44 编辑
胡编乱造版
- (defun c:tt (/ en en1 en2 en3 f pt1 pt2)
- (setq pt1 (getpoint "\n第一点:")
- pt2 (getcorner pt1 "\n第二点:"))
- (vl-cmdf "rectangle" "non" pt1 "non" pt2)
- (setq en (vlax-ename->vla-object (entlast))
- en1 (car (vlax-invoke en 'offset 1e-3))
- en2 (car (vlax-invoke en 'offset -1e-3)))
- (if (> (vlax-get en1 'length) (vlax-get en2 'length))
- (setq en3 en1
- en1 en2
- en2 en3))
- (setq f (mapcar
- 'cdr
- (vl-remove-if-not '(lambda (x) (= 10 (car x)))
- (entget (vlax-vla-object->ename en1)))))
- (vla-delete en1)
- (vla-delete en2)
- (vl-cmdf "trim"
- (vlax-vla-object->ename en)
- ""
- "f"
- "non"
- (car f)
- "non"
- (cadr f)
- "non"
- (caddr f)
- "non"
- (cadddr f)
- "non"
- (car f)
- ""
- ""))
|