各位大侠,如何把这个改编下,可以吧填充的文字面积标注到图纸上
选择多个填充可以分别标注到每个填充的中心上去(vl-load-com)
(defun c:tcx (/ thisdrawing modelspace cset hname area ll na)
(setq thisdrawing (vla-get-activedocument (vlax-get-acad-object))
modelspace(vla-get-modelspace thisdrawing)
)
(if (not (vl-catch-all-error-p
(setq cset
(vl-catch-all-apply
'vla-item
(list
(vla-get-selectionsets
thisdrawing
)
"CURRENT"
)
)
)
)
)
(vla-delete cset)
)
(if (ssget '((0 . "hatch")))
(progn
(vlax-for obj (vla-get-activeselectionset thisdrawing)
(setq hname (vla-get-patternname obj)
area(/ (vl-catch-all-apply ' vla-get-area (list obj) ) 1000000)
)
(if (= (type area) 'REAL)
(if ll
(if (setq na (assoc hname ll))
(setq ll (subst (list hname (+ area (cadr na))) na ll))
(setq ll (cons (list hname area) ll))
)
(setq ll (cons (list hname area) ll))
)
(progn
(vla-put-color obj acred)
(vla-highlight obj actrue)
)
)
)
)
)
(princ ll)
(princ)
)
页:
[1]