这并不难,你只需要得到一个区块名列表,并将其与文本文件中的列表进行比较。标准文本可能有点困难,但可以做同样的事情,我建议使用strcase作为比较的一部分,所以上下不成问题。
- this is not actual program but example bits of code
- (tblsearch "BLOCK" "Northn")
- ((0 . "BLOCK") (2 . "NORTHN") (70 . 0) (4 . "") (10 0.0 0.0 0.0) (-2 . <Entity name: 3af96230>))
- (tblsearch "BLOCK" "Nort")
- nil
- (while read file
- (setq found (tblsearch "BLOCK" blockname))
- (if (= found nil)
- (alert (strcat "block name not found " blockname))
- (princ)
- )
- .........................
- )
- (setq doc (vla-get-activedocument (vlax-get-acad-object)))
- (vlax-for blk (vla-get-blocks doc)
- (princ (vla-get-name blk) )
- )
|