问题标签 [autolisp]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
2437 浏览

visual-c++ - 使用 LISP 加载和卸载 .arx 文件

我很少有 AutoCAD 的 .arx 应用程序。在这些应用程序中,很少有基于菜单的,还有一些是命令行的。现在我想做的是,

  1. 加载 .arx 应用程序,
  2. 运行它然后
  3. 一旦 .arx 应用程序通过 LISP 命令运行,就卸载它。一旦用户单击提供的选项卡,.arx 应用程序就会运行。.arx 应用程序是用 VC++ 编写的。

现在我有一个 lisp 文件,一旦用户启动 AutoCAD,它就会被加载。在 lisp 文件中,我为各种 .arx 应用程序声明了这些函数;

(defun c:XYZ_program() (command) (command) (arxload "C:/ABC/XYZ.arx") (command "XYZ_program") (arxunload "XYZ.arx")

它适用于需要从基于菜单的表单中输入数据的程序,但是对于需要命令行输入的程序来说卸载 xyz.arx 时出错。

我想知道 LISP 中是否有任何命令可以确保 arxunload "XYZ.arx" 只执行一次(命令 "XYZ_program")。

我不确定如何解决这个问题。任何相同的帮助将不胜感激。

我目前使用的代码是这样的;

0 投票
1 回答
2375 浏览

lisp - Execute multiple commands in LISP sequentially

I am running an .arx application in AutoCAD. When we click on the customized tab in AutoCAD it runs the program in AutoCAD's commandline. The LISP function that we execute is as follows;

The process that I need to execute is "LOAD the .arx"--> "Execute it fully" --> "UNLOAD .arx"

Now when I run this for menu based input driven .arx, it works fine, but when some programs need input from AutoCAD's command line, it gives an error saying "unload failed".

I believe the process taking place here is "Load arx" --> "RUNNING through command line" --> "RUNS before arx is executed fully. and so gives an error."

Any help with this would be highly appreciated.

0 投票
3 回答
2183 浏览

compilation - 为 AutoCAD Lisp 文件构建自动化

我有一个巨大的LISP项目,我制作了一个prv文件,允许将VLIDE这个项目编译成一个vlx文件(它也编译fas文件)。问题是无法从 AutoCAD 外部或命令提示符编译项目,因此我无法vlx使用脚本自动构建。

问题是:有没有办法做到这一点?我可以fas-vlx从AutoCAD外部编译吗?或者我可以启动 AutoCAD 并提供一个编译prv然后关闭 Autocad 的脚本吗?

0 投票
2 回答
1426 浏览

c# - Re-order AutoCAD Attributes

I am trying to re-order the attributes in the AutoCAD blocks. Everytime i edit a existing block or try to create a new block the order in which the attributes are displayed is shuffled completely.

I have tried AUTOCAD commands like 'BATTMAN' 'ATTSYNC' 'BATTORDER' but the problem is i have a bunch of blocks each with 96 -150 pins in them (Each pins has an attribute reference). So it is really pain using all the above mentioned commands to arrange all the attributes in Ascending order.

Any ideas on how to resolve this using a AUTOLISP/LISP/c# program ?! Is there a way to re-order them using the tag names ?!

For example, I need to have the block attributes re-ordered from Pin1-Pin90 in an ascending order.

0 投票
2 回答
631 浏览

list - Autolisp 列表操作

我在 Autolisp 上苦苦挣扎,我找不到我正在寻找的答案。

我有一个空列表,我用已变成字符串的点坐标填充它。生成的列表类似于:

(12.5484,7.6054,0.0000 17.0626,8.1782,0.0000 17.5642,10.7199,0.0000 12.0110,11.4716,0.0000)

是否有任何可能的方式可以垂直进行列表填充并具有如下输出:

(12.5484,7.6054,0.0000
17.0626,8.1782,0.0000
17.5642,10.7199,0.0000
12.0110,11.4716,0.0000)

我正在使用的代码是:

0 投票
1 回答
156 浏览

autocad - AutoLISP drag n drop command

I am writing a lisp for autocad and I am in the final stage to create it. I want to write a command that is the same as dragging and dropping a text file into your drawing (this creates an mtext in your drawing with the content of the text file as mtext). Does anyone know the command?

Thank you.

0 投票
2 回答
443 浏览

c# - 将 AutoLISP 遗留代码转换为 C# 的最有效方法是什么?

我从事的项目主要使用 AutoCAD 设计和制造预制建筑构件,例如屋架。我们的目标之一是重新设计一个用 LISP 编写的程序,该程序用于设计屋顶桁架。我们将用 C# 重写 LISP 代码,并将其逐步实现到他们设置的当前库中。

我的问题是我的任务是构建一个基本的 LISP 到 C# 转换器。经过一些研究(因为谷歌的结果很快表明手头上并不存在这样的东西),我想到了哪种方式转换这个遗留代码会更有效的问题。用 C# 分析和重写 LISP 代码块会更好,还是我应该继续为 AutoLISP 代码开发一个基本的转换器?

0 投票
1 回答
812 浏览

autocad - 使用极坐标卡在 AutoLISP 中

好吧,我有点卡住了,不知道该怎么办。我需要使用 AutoLisp 编写程序,它会绘制五角星。我对 AutoLisp 编程一无所知,但设法写了这个,在我看来,正确,但 AutoCAD 不会绘制任何东西。也许有人可以帮忙?(长数字是以弧度表示的角度)代码:

0 投票
1 回答
1249 浏览

autolisp - LISP 文件加载但得到;错误:没有函数定义:DCL-FORM-SHOW

我有一个为 AutoCAD 2012 编写的 lisp 例程(很长),在 2012 年工作。我们已经升级到 2014,需要让这个 lisp 文件顺利运行,部分工作但我得到了上面的错误。我认为我对开放 dcl 及其当前版本的 ACAD 2014 有问题。2014 是 19.1 版是否有 dcl 19.1 版。我的 lisp 例程在 2014 年加载,但未显示相关对话框。我的用户告诉我它正在工作,并且在几天前神秘地停止了工作。

我对 autolisp 语言的了解为 0。

提供的任何帮助表示赞赏。

0 投票
1 回答
1063 浏览

text - AutoCAD 在使用 AutoLISP 时显示“问号”而不是制表符

软件:AutoCAD 2012(日语)

系统:MS Windows 7(日语)

我制作了一个.LSP 文件,它定义了一个新函数“C:MAKEATABLE”。

我正在尝试使用 AutoLISP 打印一个包含制表符的字符串。但该字符显示为问号 (?)。

如果我手动尝试编辑它(通过双击它,或使用 DDEDIT 或通过 TEXTEDIT ),它会自动转换为我需要的制表符。

我不知道正在使用哪种字符编码(如果这会导致问题)。使用的字体是“txt.shx”。

我尝试过的事情:

  • 与字符串的其余部分串联使用 (chr 9) => 仍显示为问号
  • 试图分别打印字符串的两个部分(在选项卡的两侧)=>不好,因为我需要将该文本作为单个对象
  • 尝试在代码中使用“DDEDIT”函数=>它要求用户在每次调用时按Enter,所以不好。
    • 我尝试使用 " " 、 "" 、 ";" 模拟回车键 , (三)。没有任何效果,它仍然提示用户选择另一个对象。
  • 尝试在代码中使用“TEXTEDIT”函数 => 没有做任何事情;说,“MAKEATABLE 未知命令“MAKEATABLE”。按 F1 寻求帮助。”
  • 在我的英文 PC 和英文版 AutoCAD 2012 上运行相同的代码 => 如果我使用任何 .SHX 字体,也会出现同样的问题;但如果我使用“Arial”等其他字体,效果很好

我可能错过了一两件事,所以如果需要任何其他信息,请告诉我。