明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 595|回复: 1

[提问] 创建零长度直线,代码怎么处理这样的错误

[复制链接]
发表于 2019-4-24 17:01 | 显示全部楼层 |阅读模式
  1. (defun c:tt ()
  2.     (setq p1 (getpoint "第一点:"))

  3. (setq p2  (getpoint p1 "\n**第二点:"))
  4. (command "xline" p1 p2 "")

  5.   (setq r (getdist "\n**+-距离:"))
  6. (setq ang (angle p1 p2))
  7.   (setq p1up (trans (setq p(polar p1 (- ang (* 0.5 pi)) (* r))) 1 0))
  8.     (setq p2up (trans (setq p(polar p2 (- ang (* 0.5 pi)) (* r))) 1 0))
  9.   (command "line" p1 p1up "")
  10.   (command "line" p2 p2up "")
  11.   (command "xline" p1up p2up "")
  12. )

创建零长度直线,代码怎么处理这样的错误
发表于 2023-10-29 23:55 | 显示全部楼层
我也遇到这个问题了,发现是缩放得小的时候,使用command绘制直线会这样,如果放大了视图,就正常了。还没学会用生成的方式
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-6-28 10:24 , Processed in 0.157541 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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