anandkum367 发表于 2022-7-7 15:02:05

检查图层名称

你好
 
我在一个文本文件中有一个图层名列表。如何使用列表检查autocad图形文件中的图层名,并将所有错误记录在记事本中。

Debalance 发表于 2022-7-7 15:34:21

如果没有自定义例程,恐怕这是不可能的。

BIGAL 发表于 2022-7-7 16:06:49

你们需要使用3个lisp的基本功能,目前并没有Cad,但会看看是否可以找到时间来完成。
 
打开文件
写入文件
获得分层功能
 
;file open
(setq fopen (open "mylayerlist" "R"))
; file of missing layers
(setq fout (open "mylayerlistmissing" "w"))
;layertable
(setq dwglayers (vla-get-layers
(vla-get-ActiveDocument
    (vlax-get-acad-object))

(while (setq new_line (read-line fopen))
(setq x (length dwglayers))
(repeat x
; your code compare the layer name to the layer list using Foreach or Repeat & nth etc
) ; if
) ; repeat
) ; while
页: [1]
查看完整版本: 检查图层名称