明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1086|回复: 3

[提问] 帮我看看这个双向偏移出现什么问题了

[复制链接]
发表于 2014-6-6 18:07:28 | 显示全部楼层 |阅读模式
(defun c:qq ()

(setvar "cmdecho" 0)
(setq en (entsel))
  (setq en_data (car en))
  (setq lie (entget en_data))
  (setq p1 (assoc 10 lie))
  (setq p2 (assoc 11 lie))
  (setq x1 (cadr p1))
  (setq x2 (cadr p2))
  (setq p0 (cadr en))
  (setq jl (getint "\n输入一段距离:"))
  (if (= x1 x2)
         (progn
        (setq q1 (polar p0 (* pi 0.5) jl))
        (setq q2 (polar p0 (* pi 1.5) jl))
        (command "offset" jl en_data q1 en_data q2)
        (princ)
                     )
           (progn
        (setq q1 (polar p0 0 jl))
        (setq q2 (polar p0 pi jl))
        (command "offset" jl en_data q1 en_data q2)
        (princ)
              )

                 )



(princ)


  )

发表于 2014-6-6 18:17:04 | 显示全部楼层
Try
(= x1 x2)
==>
(equal x1 x2 1e-6)
 楼主| 发表于 2014-6-6 18:36:59 | 显示全部楼层
Andyhon 发表于 2014-6-6 18:17
Try
(= x1 x2)
==>

刚学
看不懂~~~~
发表于 2014-6-6 20:09:29 | 显示全部楼层
X1 X2 是 浮点数 用 = 返回值未必正确
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-5-24 16:24 , Processed in 0.175138 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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