明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1761|回复: 3

如何将line改成pline呢

[复制链接]
发表于 2005-7-19 09:08:00 | 显示全部楼层 |阅读模式

如题,在此先谢了!

发表于 2005-7-19 09:59:00 | 显示全部楼层

(command "pedit" 要转成pline的line "" "")

或者取出line的起点p1、止点p2,删除line,再

(command "pline" p1 p2 "")

 楼主| 发表于 2005-7-19 10:35:00 | 显示全部楼层

自己做了一个小程序,请高手指点一下

(defun c2PL()
  (setq HOLDECHO (getvar "cmdecho"))
  (setvar "cmdecho" 0)
  (setq ent (entsel "\n选择<lwpolyliine> to <line>:"))
  (command "pedit" (car ent)  "y" "j")
  (command pause)
  (setvar "cmdecho" HOLDECHO)
  (princ)
)

发表于 2005-7-20 16:54:00 | 显示全部楼层

(defun c:j (/ join-ss rep1 len entnam enti)
  (setvar "CMDECHO" 0)
  (setq join-ss (ssget '((-4 . "<OR")
    (0 . "LINE")
    (0 . "ARC")
    (-4 . "<AND")
    (0 . "POLYLINE")
    (70 . 0)
    (-4 . "AND>")
    (-4 . "<AND")
    (0 . "LWPOLYLINE")
    (70 . 0)
    (-4 . "AND>")
    (-4 . "OR>")
   )
  )
  ) 
  (if (not join-ss)
    (exit)
  )
  (vl-cmdf "_.undo" "begin")
  (setq rep1 0)
  (setq len (sslength join-ss))
  (terpri)
  (repeat len
    (setq entnam (ssname join-ss rep1))
    (setq enti (entget entnam))
    (princ (strcat "\rProcessing line " (itoa (1+ rep1)) " of " (itoa len)))
    (if enti
      (if (or (= (cdr (assoc 0 enti)) "POLYLINE")
       (= (cdr (assoc 0 enti)) "LWPOLYLINE")
   )
 (command "_.pedit" entnam "j" join-ss "" "x")
 (command "_.pedit" entnam "y" "j" join-ss "" "x")
      )
    )
    (setq rep1 (1+ rep1))
  )
  (vl-cmdf "_.undo" "end")
  (setvar "CMDECHO" 1)
  (princ)
)

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

本版积分规则

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

GMT+8, 2024-11-17 18:21 , Processed in 0.164750 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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