明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1579|回复: 5

求助:如何实现双重偏移并擦除原有实体?

[复制链接]
发表于 2004-5-28 17:44:00 | 显示全部楼层 |阅读模式
下面这个程序是一本参考书上的,但是只能朝一个方向偏移,不知道是不是other点的定义有问题(标红线的部分),由于小弟初次接触lisp,还望各位多多指教 (defun c:DOF(/ a b b1 p1 d pckbox)
(setq d 20 p1 nil pee (/ pi 2) e 3 pckbox(getvar"pickbox") line "")
(if(= #parof nil)(setq #parof(/ (getvar "viewsize") 10)))
(princ "\n 请输入道路宽度<")(princ #parof)
(setq answer (getstring">:"))
(if(/= (atof answer) 0.0)(setq #parof(/ (atof answer) 2)))
(princ line)
(setvar "pickbox" pckbox)
(setq ent(entsel "\n 拾取道路中心线:"))
(setvar "pickbox" 2)
(setq point(cadr ent))
(princ line)
(setq side(getpoint "\n 拾取要偏移的一方:"))
(setq dist(distance side point))
(setq ang(angle side point))
(if(or(or(< ang 0.78)(> ang 5.5))(and(> ang 2.35)(< ang 3.92)))
(setq ang(- 0 ang))(setq ang(- pi ang))
);end if
(setq other (polar point ang dist))
(command "offset" #parof ent side ent other "")
(entdel (car ent))
(setvar "pickbox" pckbox)
(prin1)
)
(prompt "\n 键入DOF唤起命令:")
发表于 2004-5-28 17:49:00 | 显示全部楼层
参考: http://bbs.mjtd.com/forum.php?mod=viewthread&tid=16127&replyID=77917&skin=1
 楼主| 发表于 2004-5-28 21:50:00 | 显示全部楼层
您在""的时候发生错误,共有1项,下面是错误的详细信息
  • 非法的贴子参数。
  • 请仔细阅读论坛帮助文件,确保您有相应的操作权限。
  • 发表于 2004-5-29 12:21:00 | 显示全部楼层
    怎么中间会多出一个分号???再帖 http://www.mjtd.com/bbs/dispbbs.asp?BoardID=3&ID=16127&replyID=77917&skin=1
    发表于 2004-5-29 12:22:00 | 显示全部楼层
    还是不行,,,你把地址复制到地址栏里来看
     楼主| 发表于 2004-5-30 18:48:00 | 显示全部楼层
    看到了,很简捷的程序


    多谢meflying斑主了

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

    本版积分规则

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

    GMT+8, 2024-10-1 08:18 , Processed in 0.146773 second(s), 25 queries , Gzip On.

    Powered by Discuz! X3.4

    Copyright © 2001-2021, Tencent Cloud.

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