明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2656|回复: 8

[提问] 关于CAD命令前加_、_.、._的意思

[复制链接]
发表于 2015-9-28 12:51 | 显示全部楼层 |阅读模式
我看别人写的代码是这样子的:(command "._fillet" "p" s1),我想问一下这一句中在命令前加“._”有什么作用?还有这样子一行代码:(vl-cmdf "_.Pedit" "_m" ss "" "_j" "" ""),这一句中加的“_.”有什么作用?代码前加“-”是用命令提示的方式运行,但是加“_”是什么意思呢?


该贴已经同步到 用户5694667304的微博
发表于 2015-9-28 13:03 | 显示全部楼层
本帖最后由 lucas_3333 于 2015-9-28 13:06 编辑

加"-"给示以命令行方式执行,如-style ,不弹对话框,

ll_j大师曾回答过他人

1.加“.”前缀的命令的代表使用原始命令。比如在图形中屏蔽掉(undefine)一个命令,加“.”前缀即可调出该命令。例:
  • 命令: undefine
  • 输入命令名: copy
  • 命令: copy
  • 未知命令“COPY”。按 F1 查看帮助。
  • 命令: .copy
  • 选择对象: 找到 1 个
  • 选择对象:
  • 指定基点或位移,或者 [重复(M)]:
  • ...

[color=rgb(51, 102, 153) !important]复制代码


2.加“_”前缀的命令指“提供国际语言支持”。比如“copy”命令在非英文版本可能不是这样拼写,输入“copy”将不被接受,此时输入“_copy”,系统将自动翻译标准命令。
3.加“-”前缀的命令是部分命令为沿用以前版本风格而使用的“命令行”版本,可以理解为“强迫不弹出对话框”,但只有很少命令有“-”前缀,也就是说,有“-”前缀的命令和对应的没有前缀的命令实际上是两个命令。

评分

参与人数 1明经币 +1 收起 理由
冰之绝恋 + 1 赞一个!

查看全部评分

 楼主| 发表于 2015-9-28 13:45 | 显示全部楼层
lucas_3333 发表于 2015-9-28 13:03
加"-"给示以命令行方式执行,如-style ,不弹对话框,

ll_j大师曾回答过他人

那“_.”和"._"的意思是不是一样的呢?我能不能这样子理解,“_”和"."是两个分别独立的,所以“_.”和"._"的意思是一样的。
发表于 2015-9-28 13:56 | 显示全部楼层
用户5694667304 发表于 2015-9-28 13:45
那“_.”和"._"的意思是不是一样的呢?我能不能这样子理解,“_”和"."是两个分别独立的,所以“_.”和". ...

嗯,是的,  可以 (command "._pedit" ........ 也可以 (command "_.pedit"............
发表于 2015-9-28 14:07 | 显示全部楼层
http://knowledge.autodesk.com/su ... 251BFC08C3-htm.html

http://knowledge.autodesk.com/su ... 9FEB4650B1-htm.html

AutoLISP programs can be used in an AutoCAD release that supports a language other than the original language the program was developed for.

The standard AutoCAD commands and keywords used in an AutoLISP program can be automatically translated if you precede each command or keyword with an underscore (_).

(command "_line" pt1 pt2 pt3 "_c")
If you are using the dot prefix (to avoid using redefined commands), you can place the dot and underscore in either order. Both "._line" and "_.line" are valid.


Note: It is recommended to always add an underscore (_) in front of a command name or keyword when using the command or command-s functions; this will help your program to work as expected when executed in a language other than it was originally targeted for.


发表于 2015-9-28 14:16 | 显示全部楼层
学习了,谢谢lucas_3333
发表于 2015-10-17 12:32 | 显示全部楼层
lucas_3333 发表于 2015-9-28 13:03
加"-"给示以命令行方式执行,如-style ,不弹对话框,

ll_j大师曾回答过他人

内容说很详细,明了
发表于 2018-6-1 11:29 | 显示全部楼层
学习了,谢谢大神
发表于 2018-6-1 11:44 | 显示全部楼层
好像cad自带的帮助文件中有,我似乎看到过。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-6-27 04:40 , Processed in 0.143462 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表