有没有办法编辑所有blo
你好一直在浏览过去的线程,看看是否有一个lisp,可以让你选择每个块引用或块,然后把它们的所有组件放在0层和颜色层?
抱歉,如果之前有人问过这个问题,但如果有,我找不到该线程。 http://www.manusoft.com/software/Freebies/Lisp/fixblock.lsp 搜索爆炸。lsp-这就是我使用的。或者可以使用SETBYLAYER命令。我不知道是不是在2008年,但它是在2009年及以后。
我也跟不上了。。。李说它是在2008年推出的。。。 谢谢大家给我的提示,我明天会试用并反馈 我们赢了
说真的,伙计们,谢谢你们抽出时间来帮我,现在我的草稿要减少10倍,
然后再一次,
是否已经完成了将属性转移到层的操作?
因为我仍然必须返回并手动编辑其属性,并且每个图形有50多个属性,这相当耗时。 试试这个-从cadcorner
;;; File Name: Layerfix.LSP
;;; Description:Changes the block definitions to BYLAYER .Will skip all
;;; XREF & XREF dependent blocks.
;;;
;;; Global Variables:None
;;;
;;; Local Variables:Self-explanatory
;;;
;;; Program Arguments:None
;;; Subroutines/Functions Defined or Called:None
;;;
;;;***************************************************************************
(defun LAYERFIX (/ BLKDATA NEWCOLOR NEWCOLOR NEWLAYER LAYER XREFFLAG XDEPFLAG BLKENTNAME
COUNT ENTDATA ENTNAME ENTTYPE OLDCOLOR OLDLAYER SSCOUNT SS)
(command ".undo" "group")
(setq BLKDATA (tblnext "BLOCK" t))
(setq NEWCOLOR (cons 62 256));this will set 62 (color) to bylayer
; (setq NEWLAYER (cons 8 "0"));this will set 8 (layer) to 0
; While there is an entry in the block table to process, continue
(while BLKDATA
(prompt "\nRedefining colors for block: ")
(princ (cdr (assoc 2 BLKDATA)))
; Check to see if block is an XREF or is XREF dependent
(setq XREFFLAG (assoc 1 BLKDATA))
(setq XDEPFLAG (cdr (assoc 70 BLKDATA)))
; If block is not XREF or XREF dependent, i.e., regular block, then proceed.
(if (and (not XREFFLAG) (/= (logand XDEPFLAG 32) 32))
(progn
(setq BLKENTNAME (cdr (assoc -2 BLKDATA)))
(setq COUNT 1)
(terpri)
; As long as we haven't reached the end of the block's defintion, get the data
; for each entity and change its color assignment to BYLAYER.
(while BLKENTNAME
(princ COUNT)
(princ "\r")
(setq ENTDATA (entget BLKENTNAME)); get entities data
(setq OLDCOLOR (assoc 62 ENTDATA));get entities old color value
(if OLDCOLOR ; if value exist (null = bylayer)
(entmod (subst newcolor oldcolor ENTDATA)) ; substitute old color to byblock
(entmod (cons newcolor ENTDATA)) ; modify ent data w/ byblock values
)
(setq BLKENTNAME (entnext BLKENTNAME)) ;if attributes exist, then edit next one
(setq COUNT (+ COUNT 1));
) ;end while for attribute trap
) ;progn
(progn
(princ " XREF...skipping!")
) ;progn
);end if not an Xref
(setq BLKDATA (tblnext "BLOCK")) ;next block please
) ;end while loop of blk data available to edit
(command ".undo" "end")
(command ".regen")
(PROMPT "\nDone... ")
(princ)
)
(LAYERFIX)适用于除依赖外部参照的块外的所有块。 谢谢cedwards,我明天会看一看,现在刚下班 你好
您也可以尝试Edit_bloc
页:
[1]