本帖最后由 菜卷鱼 于 2014-3-21 17:37 编辑
- (defun two_pt(xx)
- (setq eo(vlax-ename->vla-object xx))
- (setq p1 (vlax-get EO 'EndPoint))
- (setq p2 (vlax-get EO 'StartPoint))
- (setq pp (list p1 p2))
- )
- (defun c:vv( )
- (setq en(car (entsel )))
- (setq px1 (car (two_pt en))
- px2 (cadr(two_pt en)))
- (setq ss(ssdel en(ssget "c" px1 px2 '((0 . "line")))))
- (setq i 0)(setq j 0)
- (repeat(sslength ss)
- (setq it (inters px1 px2 (car(two_pt (ssname ss i)))(cadr (two_pt (ssname ss i)) )) )
- (if (/= it nil)
- (progn
- (setq str (apply 'strcat (mapcar 'strcat (mapcar 'rtos it) (list "," "," ""))))
- (entmake (list '(0 . "text") (cons 1 str) (cons 10 it)(cons 40(*(getvar 'textsize)(getvar 'dimscale)) ) ))
- (setq j(1+ j))
- ))
- (setq i(1+ i))
- )
- (prin1)
- )
|