本帖最后由 jpg102329 于 2017-8-17 08:54 编辑
- (defun c:tt(/ +- A B CAN DIST ET INT LST PTA PTLST X)
- (setq a(car(jc-entsel'((0 . "*polyline"))"点选A线")))
- (setq b(jc-entsel'((0 . "*polyline"))"点选B线"))
- (setq can(if(>(* 0.5 (jc-len(car b)))(vlax-curve-getDistAtPoint (car b)(apply'vlax-curve-getclosestpointto b)))""))
- (initget 3)
- (setq dist(getdist"间距:"))
- (setq ptlst(jc-定距等分坐标表 (car b) dist can))
- (setq int 0)
- (setq lst
- (mapcar'(lambda(x)
- (setq pta(vlax-curve-getclosestpointto a x))
- (setq dist(distance pta x))
- (setq +-(if(>(car pta)(car x))"+""-"))
- (list
- (rtos(setq int(1+ int))2 0)
- (strcat +- (rtos dist))
- )
- )ptlst))
- (jc-line ptlst (mapcar '(lambda(x)(vlax-curve-getclosestpointto a x)) ptlst))
- (if(not(or(setq et(vlax-get-or-create-object"ket.application"))(setq et(vlax-get-or-create-object"et.application"))(setq et(vlax-get-or-create-object"excel.application"))))
- (progn(alert"未找到WPS或MSexcel")(exit)))
- (vla-put-visible et 1)
- (vlax-invoke(vlax-get-property ET 'WorkBooks)'Add);建工作薄
- (JC-EXCEL-PASE et "A1"lst)
- (prompt"***大懒猪荣誉出品***")
- (princ)
- )
|