将第一个函数更改为:
- ;; Points at Circle Centres within Block - Lee Mac
- ;; Prompts for selection of a block and creates points in modelspace
- ;; at the centre of every circle in the selected block
- (defun c:ptcirblk ( / bn cl en id ml ss )
- (if (setq ss (ssget '((0 . "INSERT"))))
- (repeat (setq id (sslength ss))
- (setq id (1- id)
- en (ssname ss id)
- bn (cdr (assoc 2 (entget en)))
- ml (refgeom en)
- )
- (foreach pt
- (cond
- ( (assoc bn cl)
- (cdr (assoc bn cl))
- )
- ( ( (lambda ( bd / bl bx )
- (while (setq bd (entnext bd))
- (if (= "CIRCLE" (cdr (assoc 0 (setq bx (entget bd)))))
- (setq bl (cons (trans (cdr (assoc 10 bx)) (cdr (assoc 210 bx)) 0) bl))
- )
- )
- (setq cl (cons (cons bn bl) cl))
- bl
- )
- (tblobjname "block" bn)
- )
- )
- )
- (entmake
- (list
- '(0 . "POINT")
- (cons 10 (mapcar '+ (mxv (car ml) pt) (cadr ml)))
- )
- )
- )
- )
- )
- (princ)
- )
|