乐筑天下

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

[编程交流] 如何组合多个SETVAR

[复制链接]

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 07:54:11 | 显示全部楼层
 
... 更多关于vl Load Com函数的信息。
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 08:00:38 | 显示全部楼层
 
只有当您的代码需要它时,也就是说,如果它包含任何VLISP命令。任何只包含LISP命令的程序都不需要它。如果你有疑问,把它放在那里也不会有什么坏处。
 
很多人将其设置为在AutoCAD打开时自动安装。我更喜欢低开销,只在需要时加载。如果它已经加载了,那么如果你再次调用它,系统就会忽略它,这样就相当安全了。
 
因为这篇文章是关于用代码设置系统变量的,我想已经提到过了,在这种情况下,我将重申,将原始设置分配给一些变量是一种很好的做法,以便为您保留,当您的LISP程序完成时,将其重置回原始状态。如果您的程序被其他人使用,如果您的代码将其选取框置为零,或者将osmode设置为他们不习惯使用的模式,您很快就会感到愤怒。一个好的错误处理例程也是有益的,这样即使代码在执行过程中崩溃或有人点击escape,您更改的所有内容都会恢复到原始值。只是我的2美分。
回复

使用道具 举报

24

主题

40

帖子

16

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
120
发表于 2022-7-6 08:02:12 | 显示全部楼层
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 08:05:59 | 显示全部楼层
 
... More on the vl-Load-Com function.
回复

使用道具 举报

180

主题

639

帖子

463

银币

中流砥柱

Rank: 25

铜币
897
发表于 2022-7-6 08:12:33 | 显示全部楼层
 
Only if it's required by your code, that is if it contains any VLISP commands. Any programs which contain only LISP commands will not need this. Still it won't hurt to have it in there if you're in doubt.
 
Lot's of people set this to install automatically when AutoCAD opens. I prefer low overhead and only load it when needed. And if it's already loaded the system will just ignore it if you call it again so it's pretty safe.
 
Since this post is about setting system variables with code, and I think it was already  mentioned, and in that case I will reiterate, it's a good practice to assign the original setting to some variable to hold for you and when your LISP program has completed, reset them back to their original state. If your programs are used by other people you will soon feel their wrath if your code leaves their pickbox at zero, or osmode to something other than what they are accustomed to using. A good error handling routine is also beneficial so that even if the code crashes or someone hits escape during execution, everything you changed gets set back to it's original value. Just my 2¢ worth.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-10 15:06 , Processed in 0.346132 second(s), 60 queries .

© 2020-2025 乐筑天下

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