本帖最后由 lisperado 于 2018-11-13 12:03 编辑
并不都有必要
其实写程序vla-put要自己做出判断
例如:如果没图层存在就会错误
(vla-put-layer obj "XYZ")
; error: Automation Error. Key not found
提前判断一些函数
 - (tblsearch "layer" "图层")
- (tblnext "layer")
- ;或
- (vla-get-layers ThisDrawing)
而 (vla-get-freeze ILAY)
;ILAY 应该是已知vla-object了就不必判断,除非你的程序切换开关?
以下常用VL函数功能对vla-put前判断有帮助!
举例:
vlax-method-applicable-p
vlax-property-available-p
vlax-write-enabled-p
|