ReMark 发表于 2022-7-6 00:24:28

lisp例程在哪里?你越早附上一份副本,你就可能越早找到解决问题的方法。

bienda 发表于 2022-7-6 00:27:55

我想要一个Lisp程序的关于“把甜甜圈变成圆”
 
或者将圆环的坐标导出到txt文件,其中X轴和Y轴是圆环的中心
 
谢谢

bienda 发表于 2022-7-6 00:31:12

嘿,我为我的问题做了一个新帖子
我希望有人能帮我

bienda 发表于 2022-7-6 00:35:49

我希望任何Lisp程序的大师都能帮助我
非常感谢你

ReMark 发表于 2022-7-6 00:37:03

是的,我看到了。你会给我们你已经有的lisp程序吗?就像我说的,也许它可以修改为包括甜甜圈。你说它已经在循环中起作用了,所以看起来你已经达到了95%的目标。如果没有必要,为什么要重新发明轮子?

ReMark 发表于 2022-7-6 00:42:24

这是我在你的另一个帖子中提到的lisp。
 
Donut2Cir。lsp

bienda 发表于 2022-7-6 00:43:30

谢谢你的帮助
那么,我该如何选择要更改的甜甜圈呢?
你能修复Lisp程序吗?

ReMark 发表于 2022-7-6 00:46:09

该程序为您实现了这一点。

SLW210 发表于 2022-7-6 00:50:22

为了避免混淆,我在这个帖子中添加了其他帖子。

Stefan BMR 发表于 2022-7-6 00:54:30

备注:我认为他/她想说,用lisp从圈到甜甜圈很好,但他/她需要相反的过程。
 
@比恩达:当OverKill成为ExpressTool的一部分时,它用来将“甜甜圈”转换成圆圈,但现在不再了(2014年没有了。我没有2013年的测试)。
 
^^^^这应该是你的线程的名称^^^^
 
试试这个:
(defun c:test ( / file_name open_file selected_donuts
                                       center_ocs center_wcs
                                       donut_elist index
                                       first_point second_point z_value normal)
(if
   (and
   (setq file_name (getfiled "Save text file" (getvar 'dwgprefix)"txt" 1))
   (setq selected_donuts (ssget
                           '((0 . "LWPOLYLINE")
;;;                              (8 . "0") ; add layer filter
                              (90 . 2)
                              (70 . 1)
                              (-4 . "=")
                              (42 . 1)
                              )
                           )
   )
   (setq index 0)
   )
   (progn
   (setq open_file (open file_name "w"))
   (repeat (sslength selected_donuts)
       (setq donut_elist(entget (ssname selected_donuts index))
             normal       (cdr (assoc 210 donut_elist))
             z_value      (cdr (assoc38 donut_elist))
             first_point(cdr (assoc10 donut_elist))
             second_point (cdr (assoc10 (reverse donut_elist)))
             center_OCS   (mapcar '(lambda (a b) (/ (+ a b) 2.0)) first_point second_point)
             center_WCS   (trans (append center_OCS (list z_value)) normal 0)
             index      (1+ index)
             )
       (princ (rtos (carcenter_WCS) 2 (getvar 'luprec)) open_file);   x position
       (princ "\t" open_file)
       (princ (rtos (cadr center_WCS) 2 (getvar 'luprec)) open_file);   y position
;;;      (princ "\t" open_file)
;;;      (princ (rtos (caddr center_WCS) 2 (getvar 'luprec)) open_file);   z position
       (princ "\n" open_file)
   )
   (startapp "notepad" file_name)
   (close open_file)
   )
)
(princ)
)
页: 1 [2]
查看完整版本: 如何将甜甜圈更改为cir