王与韩1 发表于 2014-9-15 10:53:49

怎么判断图纸中是否存在外部参照

RT,关于外部参照的函数不熟,请各位前辈教一下

Andyhon 发表于 2014-9-15 11:10:09

check here:
http://discussion.autodesk.com/thread.jspa?messageID=1131046

王与韩1 发表于 2014-9-15 11:34:13

Andyhon 发表于 2014-9-15 11:10 static/image/common/back.gif
check here:
http://discussion.autodesk.com/thread.jspa?messageID=1131046

这..英文水平不行,看百度翻译都看得倒懂不懂的,谢谢了

王与韩1 发表于 2014-9-15 11:48:44

大概看懂点,
setq ss (ssget "x" (list (cons 0 "insert")(cons 2 "*"))))

If the selection set is nil, there are no xrefs, otherwise
(sslength ss) tells you how many objects are attached
xrefs.
这句命令为何和他描述的不一样...有参照和没参照SS都不是nil

Andyhon 发表于 2014-9-15 12:38:56

Reply From: Bethel, David
Re: Check if Xref's exist in drawing

Ron,
via Lisp;

(defun FindXref (/ td xrf)
(while (setq td (tblnext "BLOCK" (not td)))
    (and (= (logand (cdr (assoc 70 td)) 4) 4)
         (setq xrf (cons (strcase (cdr (assoc 2 td))) xrf))
    )
)
xrf
)

王与韩1 发表于 2014-9-15 15:18:29

Andyhon 发表于 2014-9-15 12:38 static/image/common/back.gif
Reply From: Bethel, David
Re: Check if Xref's exist in drawing



谢谢,英文好能看国外技术网站真好

Gu_xl 发表于 2014-9-15 15:26:09

王与韩1 发表于 2014-9-15 15:18 static/image/common/back.gif
谢谢,英文好能看国外技术网站真好

(vlax-for a (vla-get-blocks (vla-get-ActiveDocument (vlax-get-acad-object)))
(if (= :vlax-true (vla-get-IsXRef a))
    (princ "\n图形有外部参照...")
    )
)

王与韩1 发表于 2014-9-15 16:42:02

Gu_xl 发表于 2014-9-15 15:26 static/image/common/back.gif


多谢g版,都很好用

cqu20104225 发表于 2020-2-1 23:07:25

好帖子,刚好有需要!

sandyvs 发表于 2024-3-27 17:34:41

本帖最后由 sandyvs 于 2024-3-27 18:27 编辑

Gu_xl 发表于 2014-9-15 15:26

G版,请教下,如何判断一个块是块参照还是外部参照啊?

找到一个,不知道可以不
(setq *adoc* (vla-get-activedocument (vlax-get-acad-object)))

(setq blk (car (entsel)))
(= :vlax-true (vla-get-isxref (vla-item (vla-get-blocks *adoc*) (cdr (assoc 2 (entget blk))))))

页: [1]
查看完整版本: 怎么判断图纸中是否存在外部参照