;前面的搞出来了,块B,C,D的名叫 part-row, 请高手搞一下后面的.
- (defun c:AS ( / _assoc+ doc space ss n lst pt )
- (vl-load-com)
- (defun _assoc+ ( key value lst )
- (
- (lambda ( pair )
- (if pair
- (subst (list key (+ (cadr pair) value)) pair lst)
- (cons (list key value) lst)
- )
- )
- (assoc key lst)
- )
- )
- (cond
- (
- (not
- (vlax-method-applicable-p
- (setq space
- (vlax-get-property
- (setq doc
- (vla-get-ActiveDocument
- (vlax-get-acad-object)
- )
- )
- (if (= 1 (getvar 'CVPORT)) 'Paperspace 'Modelspace)
- )
- )
- 'AddTable
- )
- )
- (princ "\n** This Version of AutoCAD Does not Support Tables **")
- )
- (
- (and (ssget (list'(0 . "INSERT") (cons 2 "part-row")))
- (progn
- (vlax-for obj (setq ss (vla-get-ActiveSelectionSet doc))
- (mapcar
- (function
- (lambda ( attrib )
- (if (setq n (distof (vla-get-TextString attrib)))
- (setq lst (_assoc+ (vla-get-TagString attrib) n lst))
- )
- )
- )
- (vlax-invoke obj 'GetAttributes)
- )
- )
- (vla-delete ss)
- (setq lst (mapcar '(lambda ( x ) (list (car x) (rtos (cadr x)))) lst))
- )
|