明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1166|回复: 3

求助!倒角问题

[复制链接]
发表于 2007-5-26 19:28 | 显示全部楼层 |阅读模式

(defun C:intln (/ sp ep e1s e1e e2s e2e e3s e3e e4s e4e pt pt1 pt2)
  (while (setq e1 (entsel "\nFirst object:"))
    (redraw (car e1) 3)
    (setq e2 (entsel "\nSecond object:"))
    (redraw (car e1) 3)
    (se (car e1))
    (setq e1s sp
          e1e ep)
    (se (car e2))
    (setq e2s sp
          e2e ep)
    (var)
    (command "fillet" "r" 0 "fillet" e1 e2)
    (setq e3 (car e1))
    (setq e4 (car e2))
    (se e3)
    (setq e3s sp
          e3e ep)
    (se e4)
    (setq e4s sp
          e4e ep)
    (if (and (/= (ds e3s e1s) 0)
          (/= (ds e3s e1e) 0)
        )
      (setq pt e3s)
      (setq pt e3e)
    )
    (if (and (/= (ds e1s e3s) 0)
          (/= (ds e1s e3e) 0)
        )
      (setq pt1 e1s)
      (setq pt1 e1e)
    )
    (if (and (/= (ds e2s e4s) 0)
          (/= (ds e2s e4e) 0)
        )
      (setq pt2 e2s)
      (setq pt2 e2e)
    )
    (command "u" "layer" "s" "DIVIDE" "" "ucs" "")
    (se e3)
    (if (= en "LINE")
      (command "line" pt pt1 "")
      (progn
        (if (= (ds pt1 e1s) 0)
          (command "arc" "c" cen pt pt1)
          (command "arc" "c" cen pt1 pt)
        )
      )
    )
    (se e4)
    (if (= en "LINE")
      (command "line" pt pt2 "")
      (progn
        (if (= (ds pt2 e2s) 0)
          (command "arc" "c" cen pt pt2)
          (command "arc" "c" cen pt2 pt)
        )
      )
    )
    (command "ucs" "p")
    (rvar)(redraw)
  )
    (setq e1 nil e2 nil e3 nil e4 nil en nil cen NIL)
    (prin1)
)
(defun se (e / sa ea ent rad)
  (setq ent (entget e))
  (setq en (cdr (assoc 0 ent)))
  (if (= en "LINE")
    (setq sp (cdr (assoc 10 ent))
          ep (cdr (assoc 11 ent)))
    (setq cen (cdr (assoc 10 ent))
          rad (cdr (assoc 40 ent))
          sa (cdr (assoc 50 ent))
          ea (cdr (assoc 51 ent))
          sp (polar cen sa rad)
          ep (polar cen ea rad))
  )
)
(defun ds (sp ep)
  (distance sp ep)
)
(prin1)


帮我看看上面的程序!

这是个倒角程序!我们在标准时碰到很多两个边倒圆角的标注!为了标注坐标,我们先有R为0的角倒起来再标坐标值,但是我这个程序在倒角时两个线还连在一起,我想要它和那个R角断开一定的距离,帮我修改一下啦,谢谢啦!

发表于 2007-5-26 20:39 | 显示全部楼层
本帖最后由 作者 于 2007-5-26 20:41:36 编辑

别的没有看,你的那句(command "fillet" "r" 0 "fillet" e1 e2)应该是有问题的

程序还没有试呢
用"int"捕捉,可以直接捕捉到两条不相交的实体的交点

还有你要选择的实体必须是在屏幕上能看到的

要不然程序会出错

 楼主| 发表于 2007-5-27 12:38 | 显示全部楼层
兄弟,怎么把CAD图档贴上来啊
 楼主| 发表于 2007-5-27 12:49 | 显示全部楼层

上面的兄弟,你可能错理解我的意思了啦!我现在的和序倒出来的角是上面的那种效果!顶我想要的效果是那下面的那种效果哦!

本帖子中包含更多资源

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

x
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-5 16:56 , Processed in 0.485713 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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