;;; 以只选取 竖直线 的方式来编程
;;; 需安装 Express Tools 取得 Acet* 函数的支持
...
...
;;; 雏型 for Test only

- (defun C:Test ()
- (VL-load-com)
- (setvar 'CLayer "0") ; Line 所在的图层
- (setvar 'OsMode 0)
- (setvar 'PickBox 1)
- (setvar 'CmdEcho 0)
- (princ "\n 选取 竖直线: ")
- (setq ss (ssget '((0 . "LINE")))
- nn (sslength ss)
- pts (acet-geom-ss-extents ss T)
- p1 (car pts)
- p3 (cadr pts)
- p4 (list (car p1) (cadr p3))
- ssL (ssget "f" (list p3 p4) '((0 . "LINE")))
- ssC (ssget "f" (list p3 p4) '((0 . "CIRCLE")))
- dat (entget (ssname ssC 0))
- Rad (cdr (assoc 40 dat))
- hh (list 0 (- (cadr p1) (cadr p3)))
- )
- (vl-cmdf "Erase" ssL "R" ss "")
- (cond
- ((> nn 2) (Test_A))
- (T (-o-o- p4 p3 ssC 0))
- )
- (setvar 'OsMode 167)
- (setvar 'PickBox 6)
- (setvar 'CmdEcho 1)
- (princ)
- )
全码如附件
;; Test ok ==> Email_4[1].TC-CC
|