外部参照附着到覆盖
lpsfiert为我找到了这个,但我无法让它工作,任何了解lsp的人都想解释一下我需要做什么才能让它工作(然后加载它并键入x2o部分,我可以使用lsp,但这个不适合我。)它一直在寻找我没有的块,但我不知道我需要创建什么块来让它工作,或者它们需要什么。如果它真的有效的话,这将对我有很大帮助。http://discussion.autodesk.com/forum...46212 我还没有正确地查看LISP,但它听起来像是文件中的查找块不在图形中
我建议清除绘图,然后运行LISP,看看是否有什么不同。 清除没有帮助。我不知道积木和这一切有什么关系,只是它们造成了一个问题 看看LISP,你是否提供了必要的参数?
(defun c:x2o () (xreftooverlay nil))
(defun xreftooverlay (namelst / uncommonblock uncommonblockclip a curlaystate cpath delme fdelme) ; xref to overlay
(if (= (type namelst) 'STR) (setq namelst (list namelst)))
(if (not namelst) (setq namelst (getxreflst)))
(setq count 0)
(while (or (findfile (strcat "ub" (itoa count) ".dwg")) (tblsearch "BLOCK" "ub" (itoa count))) (setq count (1+ count)))
(setq uncommonblock (strcat "ub" (itoa count) ".dwg"))
(command "point" "0,0" "wblock" (setq fdelme (strcat (getvar "dwgprefix") uncommonblock)) "" "0,0" (entlast) "")
(setq uncommonblockclip (substr uncommonblock 1 (- (strlen uncommonblock) 4)))
(command "undo" "begin")
(command "._-layer" "a" "save" "BEI" "" "" "")
(COMMAND ".-LAYER" "UNLOCK" "*" "")
(foreach a namelst
(setq cpath (xrefpath a))
(command "xref" "overlay" (findfile uncommonblock) "0,0" "" "" "")
(setq delme (ssget "x" (list (cons 2 uncommonblockclip))))
(command "xref" "path" uncommonblockclip cpath)
(redefxrefs a uncommonblockclip)
(command "xref" "detach" a)
(command "rename" "block" uncommonblockclip a)
(if delme (command "erase" delme ""))
) ; foreach
(command "._-layer" "a" "restore" "BEI" "" "" "")
(command "._-layer" "a" "delete" "BEI" "" "" "")
(command "._-xref" "d" "ub*")
(command "undo" "e")
(vl-file-delete (strcat fdelme))
(princ)
) ; xreftooverlay
您需要确保子例程“getxreflst”也在运行。
页:
[1]