明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 3134|回复: 4

[求助]怎么将SPLINE 线转成PLINE线!

[复制链接]
发表于 2007-1-10 22:11 | 显示全部楼层 |阅读模式

这个问题我一直没弄懂.我在网上找到一个转换程序 但是运行不起

代码入下

;; ! ****************************************************************************
;; ! PL_Spl2Pl, PL_Ell2Pl
;; ! ****************************************************************************
;; ! Function : Convert a SPLINE,ELLISPE object to a normal polyline
;; ! Arguments:
;; !            'ename'  - Name of SPLINE object
;; ! Action   : Does a DXFOUT (R12 format) and DXFIN of the SPLINE to produce a
;; !            normal polyline
;; ! Updated  : April 15, 1999
;; ! Copyright: (C) 2000, Four Dimension Technologies, Singapore
;; ! e-mail   : rakesh.rao@4d-technologies.com
;; ! Web      : www.4d-technologies.com
;; ! ****************************************************************************

(defun PL_Ell2Pl( ename )
(PL_Spl2Pl ename)
)

(defun PL_Spl2Pl ( ename / hnd elast )
(setq hnd (LI_item 5 (entget (entlast))))
(command "._Dxfout" "c:/$temp$.dxf" "_Objects" ename "" "_Version" "_R12" "_Binary")
;(if #AcadMap (command "No"))
(command "._Dxfin" "c:/$temp$.dxf")
(if (/= hnd (LI_item 5 (entget (setq elast (entlast)))))
 elast
 nil
)
)

哪位高手能够帮我分析这段代码 (这段代码里的(setq hnd (LI_item 5 (entget (entlast)))) 这条语句我感觉就有问题  根本没有定义LI_item 这个函数)或者是能告知我一个解决方法(最好附核心代码段) 谢谢了!

 楼主| 发表于 2007-1-12 18:34 | 显示全部楼层

哎 怎么没高手来讨论讨论啊!!

这里环境太死了

发表于 2007-1-12 20:13 | 显示全部楼层

(setq hnd (LI_item 5 (entget (entlast))))
(command "._Dxfout" "c:/$temp$.dxf" "_Objects" ename "" "_Version" "_R12" "_Binary")

請問你在哪找的代碼

因為你提供的不完整喔

還有上面第二行的咚咚你也看一下吧

還是有問題的

另外你想找的程式

可以搜尋一下

應該可以找到

作者可以搜尋版主 龍龍仔 的

发表于 2007-1-16 10:56 | 显示全部楼层

缺少li_item函数,

(defun PL_Ell2Pl( / ss k)
  (setq ss (ssget))
  (setq k 0)
  (repeat (sslength ss)
   (setq ename (ssname ss k))
(PL_Spl2Pl ename)
    (entdel ename)
    (setq k (+ k 1))
    )
)

(defun PL_Spl2Pl ( ename / hnd elast )
(setq hnd (LI_item 5 (entget (entlast))))
(command "._Dxfout" "c:/$temp$.dxf" "_Objects" ename "" "_Version" "_R12" "_Binary")
;(if #AcadMap (command "No"))
(command "._Dxfin" "c:/$temp$.dxf")
(if (/= hnd (LI_item 5 (entget (setq elast (entlast)))))
 elast
 nil
)
)

(defun LI_item (n e / f)
  (setq f T)
  (if f ; if f then e is an entity list.
    (cdr (assoc n e))
    (cdr (assoc n (entget e)))
  )
)

发表于 2007-1-17 19:36 | 显示全部楼层

我用了个算法实现了这个功能比这个方法好的多。呵……

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

本版积分规则

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

GMT+8, 2024-5-3 15:52 , Processed in 0.373462 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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