明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
12
返回列表 发新帖
楼主: 624777395

[提问] 直线和多段线两端画额外的线段

[复制链接]
发表于 2024-10-17 23:26:44 | 显示全部楼层


  1. (defun c:tt ()
  2.   "tt(两端画线)"
  3.   (defun abc (s1 / p1 p2 r1 r2 l1 l2)
  4.     (setq p1 (vlax-curve-getStartPoint s1)
  5.           p2 (vlax-curve-getEndPoint s1)
  6.     )
  7.     (if (not (equal p1 p2 1e-3))
  8.       (setq r1 (xyp-AngleAtPoint s1 p1)
  9.             r2 (xyp-AngleAtPoint s1 p2)
  10.             l1 (xyp-Line p1 (polar p1 r1 (- dd)))
  11.             l2 (xyp-Line p2 (polar p2 r2 dd))
  12.       )
  13.     )
  14.   )
  15.   (setq dd (Udist 7 "" "线长<输入或鼠标直接量取>" dd nil))
  16.   (setq i -1)
  17.   (if (setq ss (ssget '((0 . "*line,arc"))))
  18.     (while (setq s1 (ssname ss (setq i (1+ i))))
  19.       (abc s1)
  20.     )
  21.   )
  22.   (princ)
  23. )

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
回复 支持 0 反对 1

使用道具 举报

发表于 2024-10-18 11:19:37 | 显示全部楼层
kozmosovia 发表于 2024-10-17 20:26
任意曲线的,拐弯也不怕,端点曲线也相切

写的真好!!!!牛逼
 楼主| 发表于 2024-10-19 10:25:55 | 显示全部楼层

谢谢大佬,这就是我要的
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-2-21 03:57 , Processed in 0.150454 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表