Message 1 of 10
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Good day!
Please see my function below:
;;;;;-----===== subFunction: geoCen =====-----;;;;; (defun geoCen (ss / cntr nL pL xL yL ss cP cR) (setq cntr 0 nL () pL () xL () yL ()) (while (< cntr (sslength ss)) (setq nL (cons (ssname ss cntr) nL) cntr (1+ cntr))) (foreach x nL (cond ((= (cdr (assoc 0 (entget x))) "LINE") (setq pL (cons (cdr (assoc 10 (entget x))) pL) pL (cons (cdr (assoc 11 (entget x))) pL)) ) ((= (cdr (assoc 0 (entget x))) "LWPOLYLINE") (foreach y (entget x) (if (= (car y) 10) (setq pL (cons (cdr y) pL)))) ) ((= (cdr (assoc 0 (entget x))) "CIRCLE") (setq cP (cdr (assoc 10 (entget x))) cR (cdr (assoc 40 (entget x))) pL (cons (list (- (car cP) cR) (- (cadr cP) cR)) pL) pL (cons (list (+ (car cP) cR) (+ (cadr cP) cR)) pL)) ) ) ;cond ) ;foreach (foreach x pL (setq xL (cons (car x) xL) yL (cons (cadr x) yL))) (list (/ (+ (apply 'min xL) (apply 'max xL)) 2) (/ (+ (apply 'min yL) (apply 'max yL)) 2)) ) ;geoCen
For some reason, "CIRCLE"s aren't accounted for when the overall routine is executed and its respective points aren't considered. "LINE"s and "LWPOLYLINE"s are.
I've attached the entire routine, if you need it, for context.
Solved! Go to Solution.