 - ;; tt(平行线中线)
- (defun c:tt ()
- (if (and (setq ss (ssget '((0 . "*LINE,ARC,CIRCLE,ELLIPSE"))))
- (= (sslength ss) 2)
- )
- (progn
- (setq s1 (ssname ss 0)
- s2 (ssname ss 1)
- p1 (vlax-curve-getStartPoint s1)
- p2 (vlax-curve-getStartPoint s2)
- pt (mapcar '(lambda (x y) (* (+ x y) 0.5)) p1 p2)
- p1 (vlax-curve-getclosestpointto s1 pt)
- dd (distance pt p1)
- )
- (command "offset" dd "")
- (command "offset" "" (list s1 p1) pt "")
- (command"chprop" (entlast) "" "c" 1 "")
- )
- )
- (princ)
- )
|