本帖最后由 cabinsummer 于 2011-9-26 21:04 编辑
 - (defun c:per(/ el obj cp ep)
- (if (and (setq el (car (entsel "\n请选择直线:")))(= (cdr (assoc 0 (entget el))) "LINE"))
- (progn
- (setq obj (vlax-ename->vla-object el))
- (if (setq ep (getpoint "\n请选择点:"))
- (setq cp (vlax-curve-getClosestPointTo obj ep T));;;就是这一句求垂足
- )
- )
- )
- (princ cp)
- (princ)
- )
|