- 积分
- 15341
- 明经币
- 个
- 注册时间
- 2002-2-4
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2002-11-20 10:15:00
|
显示全部楼层
连接聚合线__这类问题请到”Autolisp/ visual lisp 编程技术”提出
本帖最后由 作者 于 2002-11-20 10:15:58 编辑
(defun C:PLINE_JOIN (/ HOLDECHO PRG SELET ENTNAME LAYNAME NAME N)
(command "_.UNDO" "GROUP")
(setq HOLDECHO (getvar "CMDECHO"))
(initget "L S ")
(prompt "\n连接聚合线...")
(setq PRG (getstring "\n输入层名(L)/指定层上实体(S)/<选择实体>: ")
)
(cond
((= PRG "L")
(while (not (tblsearch "LAYER"
(setq LAYNAME (getstring "\n输入层名: "))
)
)
)
(setq
SELET (ssget "X"
(list (cons 8 LAYNAME)
(cons 0 "LWPOLYLINE,POLYLINE,LINE,ARC")
)
)
)
)
((= PRG "S")
(while (not (setq LAYNAME (entsel "\n指定层上实体: "))))
(setq
SELET (ssget
"X"
(list (cons 8 (cdr (assoc 8 (entget (car LAYNAME)))))
(cons 0 "LWPOLYLINE,POLYLINE,LINE,ARC")
)
)
)
)
(t
(prompt "\n选择实体: ")
(setq SELET (ssget '((0 . "LWPOLYLINE,POLYLINE,LINE,ARC"))))
)
)
(setq N 0)
(setvar "CMDECHO" 0)
(if SELET
(while (setq ENTNAME (ssname SELET N))
(setq NAME (cdr (assoc 0 (entget ENTNAME))))
(if NAME
(progn
(if (or (= NAME "LWPOLYLINE") (= NAME "OLYLINE"))
(command "_.pedit" ENTNAME "J" SELET "" "")
(command "_.pedit" ENTNAME "" "J" SELET "" "")
)
)
)
(setq N (1+ N))
)
)
(setvar "CMDECHO" HOLDECHO)
(command "_.UNDO" "END")
(princ)
)
(prompt "\n连接聚合线 Type Pline_join , BY 龙龙仔")
(princ) |
|