asos2000 发表于 2022-7-6 16:10:04

这个宏有什么问题?

我创建了一个CUI宏来绘制revcloud
^C^Cpline;revcloud;arc;500;500;object;last;;
 
宏绘制pline,不应用revcloud命令

Geoffers 发表于 2022-7-6 16:19:07

你需要“普林”吗?

asos2000 发表于 2022-7-6 16:25:36

我正在为我工作的公司创建一个CUI
我想要的是,用户绘制线(pline),然后将这些线转换为revcloud。
 
我想使用弧长作为所有用户的标准。
 
有什么建议吗

Lee Mac 发表于 2022-7-6 16:30:44

从多段线构建云线时,多段线必须闭合。我有两分钟的时间,所以这个Lisp程序将完成同样的事情:
 

; Polyline Revcloud by Lee McDonnell 21/12/2008

(defun c:prev (/ *error* l1 l2)

   (defun *error* (msg)
   (setvar "cmdecho" 1)
   (if (= msg "")
       (princ "\nFunction Complete.")
       (princ "\nError or Esc Pressed!")
   ) ;_end if
   (princ)
   ) ;_end defun

   (setvar "cmdecho" 0)
   (prompt "\nConstruct Polyline.")
   (command "_pline")
   (while (> (getvar "cmdactive") 0) (command pause))
   (setq l1 (entlast))
   (command "_pedit" l1 "c" "")
   (setq l2 (entlast))
   (prompt "\nReverse Cloud Direction? : ")
   (command "_revcloud" "o" l2 pause)
   (*error* "")
   (princ)
) ;_end defun

asos2000 发表于 2022-7-6 16:34:43

这是不是意味着,我不能使用宏?

Lee Mac 发表于 2022-7-6 16:42:23

好吧,让我们只说,使用宏来完成相同的任务会很尴尬,因为宏必须确保在执行到rev云的转换之前闭合多段线-我个人会选择LISP。

asos2000 发表于 2022-7-6 16:51:45

就我个人而言,我喜欢LISP,但当处理60多台电脑时,我会将LISP加载到所有这些电脑上。
在这种情况下,我更喜欢制作CUI按钮(菜单在服务器上共享)
 
我们可以用它来确保pline是闭合的
 

Lee Mac 发表于 2022-7-6 16:56:31

好的,没问题-只是给你提供了另一个选择。

Lee Mac 发表于 2022-7-6 17:03:51

可能对于现有多段线:
 

; Polyline Rev-cloud by Lee McDonnell (Polyline Selection) - 21/12/2008

(defun c:prev2 (/ *error* ent ent1)

   (defun *error* (msg)
   (setvar "cmdecho" 1)
   (if (= msg "")
       (princ "\nFunction Complete.")
       (princ "\nError or Esc Pressed!")
   ) ;_end if
   (princ)
   ) ;_end defun

   (setvar "cmdecho" 0)
   (while
   (setq ent (entsel "\nSelect Polyline: "))
      (command "_pedit" ent "c" "")
      (setq ent1 (entlast))
      (prompt "\nReverse Direction of Cloud? <No> : ")
      (command "_revcloud" "O" ent1 pause)
   ) ;_end while
   (*error* "")
   (princ)
) ;_end defun

 
(有点得意忘形)

asos2000 发表于 2022-7-6 17:04:36

李先生
你怎么写LISP?
使用记事本,还是什么?
页: [1] 2
查看完整版本: 这个宏有什么问题?