- 积分
- 2632
- 明经币
- 个
- 注册时间
- 2006-10-1
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
请教一下大神,以下代码,可以在07版本实现,但是2020里面它提示“指定要向内偏(N)外偏(W):N ; 错误: 参数类型错误: consp 0.0” 请问是怎么回事呢
请各位论坛大神解惑
框选偏移
(defun c:hh (/ bz ss aba2 aba1 abb aba aba4 aba3 aaa aac aab pt1 pt3 pt1x pt1y pt3x pt3y pt aba_1);;快速偏移
(setvar "CMDECHO" 0)
(command "undo" "be")
(command "ucs" "w")
(setq bz(getvar "OSMODE"))
(setvar "OSMODE" 0)
(setq ss(ssget)aba2(sslength ss) aba1 0)
(setq abb(GETREAL "\n输入偏移值:"))
(INITGET 128 "Nai Wai")
(setq aba(getkword"\n指定要向内偏(N)外偏(W):"))
(IF(= ABA "Nai")
(progn (repeat aba2
(setq aba4(ssname SS aba1))
(setq aba3(entget aba4))
(setq aaa 10
aac (assoc 10 aba3)
aab (nth aaa aba3)
)
(while (/= aab aac)
(setq aab (nth aaa aba3))
(setq aaa (+ aaa 1))
)
(setq pt1 (cdr (nth (- aaa 1) aba3))
pt3 (cdr (nth (+ aaa 7) aba3))
)
(SETQ PT1X (CAR PT1)
PT3X (CAR PT3)
PT1Y (CADR PT1)
PT3Y (CADR PT3)
)
(SETQ PTX (/ (+ PT1X PT3X) 2)
PTY (/ (+ PT1Y PT3Y) 2)
PT (LIST PTX PTY)
)
(command "OFFSET" abb aba4 pt "")
(setq aba1(+ aba1 1))
))
(progn (setq aba_1(getpoint "\n指定偏移方向"))
(repeat aba2
(setq aba4(ssname SS aba1))
(setq aba3(entget aba4))
(command "OFFSET" abb aba4 aba_1 "")
(setq aba1(+ aba1 1))
)))
(command "undo" "e")
(command "ucs" "p")
(setvar "OSMODE" bz)
(setvar "CMDECHO" 1)
(princ)
)
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
x
|