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