C3D 2016 LISP不工作
我刚刚了解到,我们的一些旧LISP在C3D 2016中不起作用,正在寻求帮助。如果您能提供任何帮助,我们将不胜感激。下面是一个不再有效的LISP示例。(defun C:ROSNAP ()
(graphscr)
(setq oldsnap (getvar "osmode"))
(setq smd (getvar "snapmode"))
(setq tll (entsel "Select Object: "))
(setq tlle (car tll))
(setq pt1 (cadr tll))
(setq nme (cdr (assoc 0 (entget tlle))))
(if (= nme "LINE") (progn
(setq pt2 (osnap pt1 "mid,qui"))
(setq pt3 (osnap pt1 "end,qui"))
(command "SNAP" "R" pt2 pt3)))
(if (= nme "POLYLINE") (progn
(setq pt2 (osnap pt1 "mid,qui"))
(setq pt3 (osnap pt1 "end,qui"))
(command "SNAP" "R" pt2 pt3)))
(if (= nme "ARC") (progn
(setq pt2 (osnap pt1 "end,qui"))
(setq pt3 (osnap pt1 "cen,qui"))
(command "SNAP" "R" pt2 pt3)))
(setvar "snapmode" smd)
(setvar "osmode" oldsnap)
) 这是一个已知问题,您需要将命令更改为VL cmdf或COMMAND-s
请告诉我在哪里可以了解更多关于这个已知问题的信息。谢谢 只有谷歌,我也必须更改一堆代码。我一次只做了60个左右。
; this is the core so need to add findfile etc
; Convert command to command-s
; by BIG-AL May 2015
; add rename and findfile
(defun AH:command-s (exfile / newfile fo f2)
(vl-load-com)
(setq newfile (strcat exfile ".BAK"))
(vl-file-rename exfile newfile)
(setq fo (open newfile "R"))
(setq f2 (open exfile "w"))
(while (setq str (read-line fo))
(setq str (VL-string-subst "COMMAND-S" "COMMAND" (strcase str) ))
(princ (strcat "\n" str))
(write-line str f2)
)
(close fo)
(close f2)
(princ)
)
(ah:command-s "C:/Temp/test.lsp")
; just add lots of lisps here
VL cmdf或Command-s的更好替代品是什么?
其实并不是这么简单。我在第一篇文章中尝试了这两种方法,但两种方法都不适用于我最初的示例。 Command-s应该可以工作,请阅读:https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlisp-what-to-do-with-command-s/td-p/5058168?nobounce
你有什么样的错误或输出?
我读到这篇文章时脑子里有一个大大的问号。我想指出我的问题是在C3D 2016中。
在我最初的LISP中,我遇到了以下错误:
Command: RoSnap Select Object: SNAP
Command: r Unknown command "R".Press F1 for help.
将“command”更改为“command-s”后,我出现以下错误:
Command: RoSnap Select Object: Application ERROR: Invalid type sent as command input
; error: Unknown (command-s) failure. 虽然“R”期权在2015年有效,但它不再列为期权。我还没有安装2016,你有没有试着在命令行上查看“Snap R”在2016年是否有效? 当我看到你的代码时,我认为这是一种有趣的方法,以前从未见过这样做的旋转。您可能需要重写以围绕点旋转实体。
页:
[1]
2