æ ·æ¡æ²çº¿ç»å¶å线ï¼æ个æ¹æ³ï¼å°±æ¯ãå移对象ãï¼ç¶åæ¾å°å¯¹åºç¹ãç»å¶å¯¹åºç¹çåç´çº¿ãæ ¹æ®è¿ä¸ªåçç¼ç¨æ¥ç»å¶å线ã
autolispç¼ç¨ä»£ç å¦ä¸ï¼
(defun c:tes ( / &ang1 &dis1 &k1 &n1 &p1 &p2 ent1)
(if (null vlax-dump-object) (vl-load-com) )
(if (and (setq &k1 (entsel "\n请éæ©æ ·æ¡æ²çº¿æå弧"))
(setq &k1 (car &k1))
(member (cdr (assoc 0 (entget &k1))) '("ARC" "SPLINE"))
(setq &k1 (vlax-ename->vla-object &k1))
(setq &p1 (getpoint "\n请éæ©å线ç¹"))
(> (setq &dis1 (* 0.1 (vlax-curve-getDistAtParam &k1 (vlax-curve-getEndParam &k1)))) 0)
(setq &p1 (vlax-curve-getclosestpointto &k1 &p1))
(setq &n1 (vlax-curve-getParamAtPoint &k1 &p1))
(null (vl-catch-all-error-p (vl-catch-all-apply 'vla-offset (list &k1 0.01))))
(setq ent1 (entlast))
(setq &p2 (vlax-curve-getPointAtParam ent1 &n1))
)
(progn
(entdel ent1)
(setq &ang1 (+ (angle &p1 &p2) (* pi 0.5)))
(setq &p2 (polar &p1 &ang1 &dis1) &p1 (polar &p1 &ang1 (* &dis1 -1.0)))
(entmake (list '(0 . "LINE") (cons 10 &p2) (cons 11 &p1)))
)
)
(princ)
)
追é®ç¼ç¨çä¸æï¼è¿ä¹å¤ªé«é¾åº¦äºï¼æå¾
æ´ç®åçæ¹æ³
追çå¤å¶ç¨åºå°è®°äºæ¬ï¼ä»¥ã.lspã为åç¼å½åï¼æå¼cadï¼å½ä»¤ãapploadãå è½½ç¨åºï¼å½ä»¤ãTESãå°±å¯ä»¥ç»å¶å线ã
æå¨ç»å¶å线ï¼å移对象ï¼å¯¹åºçç¹è¿æ¥ï¼å°±æ¯åç´çº¿ã
æ ¹æ®åç´çº¿æå线ï¼å½ä»¤ãROãæ转对象ã