- 积分
- 74725
- 明经币
- 个
- 注册时间
- 2001-6-7
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2002-8-19 12:41:00
|
显示全部楼层
有,程序改好了,如内
(defun c:OFFDEL (/ oldcmdecho ofdist dist)
(princ " OFFDEL 偏移并删除源对象")
(setq oldcmdecho (getvar "cmdecho"))
(setvar "cmdecho" 0)
(setq ofdist (getvar "OFFSETDIST"))
(if (> ofdist 0)
(progn
(initget "T")
(setq dist (getdist (strcat "\n指定偏移距离或 [通过(T)] <"
(rtos ofdist)
">:"
)
)
)
(if (= dist nil)
(setq dist ofdist)
)
(if (or (= dist "T") (= dist "t"))
(offwithpnt)
(offwithdist dist)
)
)
(progn
(initget "T")
(setq dist (getdist "\n指定偏移距离或 [通过(T)] <通过>:"))
(if (= dist nil)
(setq dist "T")
)
(if (or (= dist "T") (= dist "t"))
(offwithpnt)
(offwithdist dist)
)
)
)
(setvar "cmdecho" oldcmdecho)
(princ "\n该命令由明经通道 http://www.mjtd.com 制作")
(princ)
)
(defun offwithdist (dist / obj pnt)
(while (setq obj
(I:entself
"\n选择要偏移的对象或 <退出>:"
'((0
.
"Arc,Circle,Ellipse,Line,LightweightPolyline,Polyline,Spline,XLine"
)
)
)
)
(setq pnt (getpoint "\n指定点以确定偏移所在一侧:"))
(command "._offset" dist obj pnt "")
(entdel (car obj))
)
(setvar "offsetdist" dist)
(princ)
)
(defun offwithpnt (/ obj pnt)
(while (setq obj
(I:entself
"\n选择要偏移的对象或 <退出>:"
'((0
.
"Arc,Circle,Ellipse,Line,LightweightPolyline,Polyline,Spline,XLine"
)
)
)
)
(setq pnt (getpoint "\n指定通过点:"))
(command "._offset" "T" obj pnt "")
(entdel (car obj))
)
(setvar "offsetdist" -1)
(princ)
)
(defun I:EntSelF (Msg Filter / EntN pbDist PtPick ssPick)
(while (not EntN)
(setq EntN (if Msg
(entsel Msg)
(entsel)
)
)
(if (= (getvar "ErrNo") 52)
(setq EntN "Exit")
)
)
(cond
((/= EntN "Exit")
(setq
pbDist (abs
(/
(*
(/
(getvar " ickBox")
(cadr (getvar "ScreenSize"))
)
(getvar "ViewSize")
)
(sin (* 0.25 pi))
)
)
PtPick (cadr EntN)
)
(if (setq ssPick (ssget "_C"
(polar PtPick (* 1.25 pi) pbDist)
(polar PtPick (* 0.25 pi) pbDist)
Filter
)
)
(cons
(ssname ssPick 0)
(list PtPick)
)
)
)
)
) |
|