本帖最后由 xyp1964 于 2017-11-20 21:54 编辑
- ;; xyp-Line vl方式画线(点与点、点集与点、点与点集、点集与点集) (xyp-Line p1 p2)
- (defun xyp-Line (p1 p2 / s0 pt pt1 pt2 i ss)
- (setq s0 (entlast))
- (cond
- ;; 点集与点
- ((and (= (type (car p1)) 'LIST)
- (or (= (type (car p2)) 'REAL)
- (= (type (car p2)) 'INT)
- )
- )
- (mapcar '(lambda (x) (xyp-line x p2)) p1)
- (setq ss (xyp-SSelEntnext s0))
- )
- ;; 点与点集
- ((and (= (type (car p2)) 'LIST)
- (or (= (type (car p1)) 'REAL)
- (= (type (car p1)) 'INT)
- )
- )
- (mapcar '(lambda (x) (xyp-line p1 x)) p2)
- (setq ss (xyp-SSelEntnext s0))
- )
- ;; 点集与点集
- ((and (= (type (car p1)) 'LIST)
- (= (type (car p2)) 'LIST)
- (= (length p1) (length p2))
- )
- (mapcar '(lambda (x y) (xyp-line x y)) p1 p2)
- (setq ss (xyp-SSelEntnext s0))
- )
- ;; 点与点、
- ((and (or (= (type (car p1)) 'REAL)
- (= (type (car p1)) 'INT)
- )
- (or (= (type (car p2)) 'REAL)
- (= (type (car p2)) 'INT)
- )
- )
- (vla-addline
- (vla-get-ModelSpace
- (vla-get-ActiveDocument (vlax-get-acad-object))
- )
- (vlax-3D-point p1)
- (vlax-3D-point p2)
- )
- (setq ss (entlast))
- )
- )
- ss
- )
|