- (defun c:f1 ( / a b line1 line2 ps1 ps2 pt1 pt2 ss)
- (vl-load-com)
- (setq ss (ssget '((0 . "*line")))) ;“,” 逻辑或,对象类型可多选,名称用 “,” 分
- ;隔。例如,创建直线和文本的选择集,框选对象后,将只有文本被选中(亮显)并加入选择集。
- (setq line1 (ssname ss 0));获取直线1的图元信息
- (setq line2 (ssname ss 1))
- (setq PS1 (HH:PtLists line1))
- (setq PS2 (HH:PtLists line2))
- (setq Pt1 (car (vl-sort PS1 '(lambda(a b) (< (cadr a) (cadr b))))))
- (setq Pt2 (car (vl-sort PS2 '(lambda(a b) (< (cadr a) (cadr b))))))
- (command "line" PT1 pt2 "")
- (print)
- )
- (defun HH:PtLists (en)
- (list
- (vlax-curve-getstartpoint (vlax-ename->vla-object en))
- (vlax-curve-getendpoint (vlax-ename->vla-object en))
- )
- )
你看下行不行 |