乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 76|回复: 3

[编程交流] 添加revcloud+另一个命令

[复制链接]

7

主题

21

帖子

14

银币

初来乍到

Rank: 1

铜币
35
发表于 2022-7-6 17:05:38 | 显示全部楼层 |阅读模式
大家好
我一直在尝试使用revcloud命令创建lisp。此命令之前的所有操作都有效,但一旦它到达revcloud,lisp将在绘制云后终止。我需要再添加一个命令以将ucs重置为world。我想使用acad命令,而不是自制的。
回复

使用道具 举报

4

主题

940

帖子

961

银币

初来乍到

Rank: 1

铜币
12
发表于 2022-7-6 17:36:00 | 显示全部楼层
尝试将其放在revcloud命令之后和UCS之前
  1. (while (> (getvar 'CmdActive) 0) (command pause))

顺便提一下如果您真的发布了代码,那么调试代码会更容易。
回复

使用道具 举报

7

主题

21

帖子

14

银币

初来乍到

Rank: 1

铜币
35
发表于 2022-7-6 17:59:22 | 显示全部楼层
谢谢,做得很好。下次我会发帖子,因为我没有发表评论
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 18:15:44 | 显示全部楼层
不确定这是否有用
 
 
  1. ;|
  2.    .: Revision Marker :.
  3.    .: by Lee McDonnell:.
  4.     .: December 2008 :.
  5.         SYNTAX: REV
  6.     BASE VARIABLES SYNTAX: REVSET
  7. |;
  8. (defun c:rev () (c:RevisionMarker)) ; Program Shortcut
  9. (defun Laymake ()
  10.    (if    (not (tblsearch "layer" "REV"))
  11.    (progn
  12.        (command "-layer" "m" "REV" "c" "2" "REV" "")
  13.        (princ "\nCreating Revision Layer: ")
  14.    ) ;_  end progn
  15.    (setvar "clayer" "REV")
  16.    ) ;_  end if
  17. ) ;_  end defun
  18. (defun c:RevisionMarker    (/ *error* varLst oldVars revpt pt1 txt txtpt)
  19. ; --- Error Trap ---
  20.    (defun *error* (msg)
  21.    (mapcar 'setvar varLst oldVars)
  22.    (if (= msg "")
  23.        (princ "\nFunction Complete.")
  24.        (princ "\nError or Esc pressed... ")
  25.    ) ;_  end if
  26.    (princ)
  27.    ) ;_  end defun
  28. ; --- Error Trap ---
  29.    (or (getenv "Rev:Side") (setenv "Rev:Side" "6"))
  30.    (or (getenv "Rev:Text") (setenv "Rev:Text" "2.5"))
  31.    (or (getenv "Rev:Amin") (setenv "Rev:Amin" "2"))
  32.    (or (getenv "Rev:Amax") (setenv "Rev:Amax" "2"))
  33.    (princ
  34.    (strcat
  35.        "\nType "RevSet" to set Base Variables - Current Settings: \nSide Length: "
  36.        (getenv "Rev:Side")
  37.        ", Text Height: "
  38.        (getenv "Rev:Text")
  39.        ", Arc Length Min: "
  40.        (getenv "Rev:Amin")
  41.        ", Arc Length Max: "
  42.        (getenv "Rev:Amax")
  43.    ) ;_  end strcat
  44.    ) ;_  end princ
  45.    (setq varLst  (list "CMDECHO" "CLAYER" "BLIPMODE" "OSMODE")
  46.      oldVars (mapcar 'getvar varLst)
  47.    ) ;_  end setq
  48.    (setvar "cmdecho" 0)
  49.    (setvar "blipmode" 0)
  50.    (Laymake)
  51.    (command "_revcloud"
  52.         "A"
  53.         (atof (getenv "Rev:Amin"))
  54.         (atof (getenv "Rev:Amax"))
  55.    ) ;_  end command
  56.    (while (> (getvar "CmdActive") 0) (command pause))
  57.    (setvar "osmode" 0)
  58.    (if
  59.    (and (/= (setq
  60.             pt1
  61.            (getpoint "\nSelect Point for Rev Triangle: "
  62.            ) ;_  end getpoint
  63.         ) ;_  end setq
  64.         nil
  65.         ) ;_  end /=
  66.         (/= (setq
  67.             txt (getstring
  68.                 t
  69.                 "\nSpecify Text for Rev Triangle: "
  70.             ) ;_  end getstring
  71.         ) ;_  end setq
  72.         ""
  73.         ) ;_  end /=
  74.    ) ;_  end and
  75.       (progn
  76.           (setq txt (strcase txt))
  77.           (command
  78.           "_.pline"
  79.           "_non"
  80.           pt1
  81.           "_non"
  82.           (polar pt1
  83.              (/ (* -1 pi) 3)
  84.              (atof (getenv "Rev:Side"))
  85.           ) ;_  end polar
  86.           "_non"
  87.           (polar pt1
  88.              (/ (* -2 pi) 3)
  89.              (atof (getenv "Rev:Side"))
  90.           ) ;_  end polar
  91.           "_C"
  92.           ) ;_  end command
  93.           (setq txtpt
  94.            (polar
  95.                pt1
  96.                (/ (* pi 3) 2)
  97.                (/ (/ (atof (getenv "Rev:Side")) 2)
  98.                   (cos (/ pi 6))
  99.                ) ;_  end /
  100.            ) ;_  end polar
  101.           ) ;_  end setq
  102.           (entmake
  103.           (list '(0 . "TEXT")
  104.             '(8 . "REV")
  105.             (cons 10 txtpt)
  106.             (cons 40 (atof (getenv "Rev:Text")))
  107.             (cons 1 txt)
  108.             '(50 . 0.0)
  109.             '(7 . "STANDARD")
  110.             '(71 . 0)
  111.             '(72 . 1)
  112.             '(73 . 2)
  113.             (cons 11 txtpt)
  114.           ) ; end list
  115.           ) ; end entmake
  116.       ) ;_  end progn
  117.    ) ;_  end if
  118.    (*error* "")
  119.    (princ)
  120. ) ;_  end defun
  121. (defun c:RevSet    (/ side text amin amax)
  122.    (or (getenv "Rev:Side") (setenv "Rev:Side" "6"))
  123.    (or (getenv "Rev:Text") (setenv "Rev:Text" "2.5"))
  124.    (or (getenv "Rev:Amin") (setenv "Rev:Amin" "2"))
  125.    (or (getenv "Rev:Amax") (setenv "Rev:Amax" "2"))
  126.    (princ (strcat "\nCurrent Settings: \nSide Length: "
  127.           (getenv "Rev:Side")
  128.           ", Text Height: "
  129.           (getenv "Rev:Text")
  130.           ", Arc Length Min: "
  131.           (getenv "Rev:Amin")
  132.           ", Arc Length Max: "
  133.           (getenv "Rev:Amax")
  134.       ) ;_  end strcat
  135.    ) ;_  end princ
  136.    (if    (setq side (getreal (strcat "\nSpecify Side Length <"
  137.                    (getenv "Rev:Side")
  138.                    "> : "
  139.                ) ;_  end strcat
  140.           ) ;_  end getreal
  141.    ) ;_  end setq
  142.    (setenv "Rev:Side" (rtos side))
  143.    ) ;_  end if
  144.    (if    (setq text (getreal (strcat "\nSpecify Text Height <"
  145.                    (getenv "Rev:Text")
  146.                    "> : "
  147.                ) ;_  end strcat
  148.           ) ;_  end getreal
  149.    ) ;_  end setq
  150.    (setenv "Rev:Text" (rtos text))
  151.    ) ;_  end if
  152.    (if    (setq amin (getreal (strcat "\nSpecify Min Arc Length <"
  153.                    (getenv "Rev:Amin")
  154.                    "> : "
  155.                ) ;_  end strcat
  156.           ) ;_  end getreal
  157.    ) ;_  end setq
  158.    (setenv "Rev:Amin" (rtos amin))
  159.    ) ;_  end if
  160.    (if    (setq amax (getreal (strcat "\nSpecify Max Arc Length <"
  161.                    (getenv "Rev:Amax")
  162.                    "> : "
  163.                ) ;_  end strcat
  164.           ) ;_  end getreal
  165.    ) ;_  end setq
  166.    (setenv "Rev:Amax" (rtos amax))
  167.    ) ;_  end if
  168.    (princ "\nBase Variables Set. ")
  169.    (princ)
  170. ) ;_  end defun
  171. (princ
  172.    "\nRevision Marker by Lee Mac Loaded. Type "REV" to Invoke."
  173. ) ;_  end princ
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-4 19:19 , Processed in 1.046911 second(s), 60 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表