绘图中的块大小
是否可以生成块及其大小的列表(kb)?我经常收到客户的图纸,有时文件大小很大,包含数百个区块。我希望能够运行一个例程,告诉我哪些块对大文件大小的影响最大,这样我就可以调查它们,并尝试将文件大小降低到更易于管理的程度。
谢谢
抢劫 您可以使用BCOUNT生成插入块的列表,并编写脚本以通过WBLOCK将这些块保存在磁盘上。完成后,在Explorer中对其进行排序。
-WBLOCK PathToExport NameOfBlock<p>;end of script</p><p>By the way, this will not treat the not inserted ones.</p> 下面将报告每个块中组件的数量-这不一定会揭示内存使用量方面最大的块定义(因为一些实体需要比其他实体更多的内存来定义),但它可以提供关于哪些块主要影响文件大小的总体概念:
(defun c:bsize ( / l )
(vlax-for b (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))
(if (and (= :vlax-false (vla-get-islayout b))
(= :vlax-false (vla-get-isxref b))
)
(setq l (cons (cons (vla-get-name b) (vla-get-count b)) l))
)
)
(if l
(progn
(princ (LM:padbetween "\nBlock Name" "Components" "." 51))
(princ (LM:padbetween "\n" "" "=" 51))
(foreach x (vl-sort l '(lambda ( a b ) (> (cdr a) (cdr b))))
(princ (LM:padbetween (strcat "\n" (car x)) (itoa (cdr x)) "." 51))
)
(princ (LM:padbetween "\n" "" "=" 51))
)
(princ "\nNo blocks found.")
)
(princ)
)
;; Pad Between-Lee Mac
;; Returns the concatenation of two supplied strings padded to a
;; desired length using a supplied character.
;; s1,s2 - strings to be concatenated
;; ch - character for padding
;; ln - minimum length of returned string
(defun LM:padbetween ( s1 s2 ch ln )
( (lambda ( a b c )
(repeat (- ln (length b) (length c)) (setq c (cons a c)))
(vl-list->string (append b c))
)
(ascii ch)
(vl-string->list s1)
(vl-string->list s2)
)
)
(vl-load-com) (princ)
关于上述每个块的引用数,请考虑使用我的嵌套块计数器程序或块计数器程序。
我希望这有帮助,
李 仔细查看任何名为$aec62Fe45jk的块。这些块通常是复制和粘贴块,可以包含大量信息,如完整的dwg,最好单独保存并使用外部参照。
页:
[1]