混沌初开 发表于 2013-11-30 17:41:29

混沌初开 发表于 2013-11-30 17:39 static/image/common/back.gif
试了一下,用上楼的"五星"串线,有时一下能串好,有时候还让选择(如下图)

失灵时候的样子

Andyhon 发表于 2013-11-30 19:01:50

有请附上 如上 的调试用*.Dwg

混沌初开 发表于 2013-11-30 19:12:32

串线dwg档

Andyhon 发表于 2013-11-30 19:42:52

本帖最后由 Andyhon 于 2013-11-30 19:48 编辑

CAD2004 ok
-------------------

Command: (defun c:TT(/ aa)
(_>   (setq aa (ssget))
(_>   (command "PEDIT" "M" aa "" "j" "" "")
(_> (princ)
(_>   )
C:TT

Command: tt

Select objects: Specify opposite corner: 16 found

Select objects:
PEDIT Select polyline or : M
Select objects:   16 found

Select objects:
Enter an option : j
Join Type = Extend
Enter fuzz distance or <0.0000>:
15 segments added to polyline

Enter an option :
Command:
==============================
另请参考:
Type: Integer
Saved in: Registry
Initial value: 0
Suppresses display of the Object Selected Is Not a Polyline prompt in PEDIT.
The prompt is followed by "Do you want it to turn into one?"
Entering y converts the selected object to a polyline.
When the prompt is suppressed,
the selected object is automatically converted to a polyline.

0 The prompt is displayed
1 The prompt is suppressed

混沌初开 发表于 2013-12-1 00:28:36

Andyhon 发表于 2013-11-30 19:42 static/image/common/back.gif
CAD2004 ok
-------------------



发的是什么意思?

llsheng_73 发表于 2013-12-1 02:11:12

本帖最后由 llsheng_73 于 2013-12-1 02:33 编辑

是有时会选到直线,弧等,所以会问你是否转换为多线段吧?
(defun c:TT(/ a b c i n f)
(setq a(ssget)i 0)
(if a(progn(setq n(sslength a))
   (while(< i (sslength a))
   (setq b(cdr(assoc 0(entget(setq c(ssname a i)))))i(1+ i))
   (if (not(member b'("POLYLINE""LWPOLYLINE""LINE""ARC")))(setq a(entdel c a))
       (if(member b'("LINE""ACR"))(setq f t))))
   (if f(command "PEDIT" "M" a """Y" "j" "" "")(command "PEDIT" "M" a "" "j" "" ""))))
(princ)
   )
;;先看下选中的东东里边是否有不是多线段但能转换为多线段的?
;;好象还应该优化,因为PE的时候它会自动剔除一些实体类别?

混沌初开 发表于 2013-12-1 20:52:20

73大神,真厉害!

hhh454 发表于 2013-12-6 08:11:22

论坛里面我早就发了一个,他会有一个提示,确认转换的
http://bbs.mjtd.com/thread-84513-1-1.html

自贡黄明儒 发表于 2013-12-6 08:44:36

猜测LZ要如下代码
;;164.29 [功能] 连接线、弧成多段线
;;(HH:JionToPolyline)
(defun HH:JionToPolyline (/ PET SS)
(setq pet (getvar "PEDITACCEPT"))
(setvar "PEDITACCEPT" 1)
(while (setq ss (ssget '((0 . "ARC,*LINE"))))
    (command "_.pedit" (ssname ss 0) "j" ss "" "")
)
(setvar "PEDITACCEPT" pet)
(princ)
)
页: 1 [2]
查看完整版本: 快速串线