@Anonymous wrote:How to distribute object (circle) in selection of great number of points?
Welcome to the forum lovearts123!
If I understand correctly, maybe something like this:
(defun c:test (/ I SS) (if (setq ss (ssget '((0 . "POINT")))) (progn (setq i (sslength ss)) ;; set index the number of entities in the selection set (while (not (minusp (setq i (1- i)))) ;; while the index is non-negative, subtract one to index (entmake (list '(0 . "CIRCLE") '(8 . "Sample-Circle") ;; layer ' (62 . 1) ;; color 1 (cons 10 (cdr (assoc 10 (entget (ssname ss i))))) ;; center point from the the coordinates of each selected point ' (40 . 1.0) ;; diameter ) ) ;; entmake ) ;; while ) ;; if ) ;; progn (princ) ) ;; test
hope that helps
Henrique
This is also how I understood the request from the OP.
@hmsilva,
Note that
(cons 10 (cdr (assoc 10 (entget (ssname ss i)))))
is the same as:
(assoc 10 (entget (ssname ss i)))
Hence, your code could become:
(defun c:test ( / i s ) (if (setq s (ssget '((0 . "POINT")))) (repeat (setq i (sslength s)) (entmake (list '(0 . "CIRCLE") '(40 . 1.0) (assoc 10 (entget (ssname s (setq i (1- i))))))) ) ) (princ) )
Also, note that DXF Group 40 is the Circle radius, not diameter.
@Lee_Mac wrote:This is also how I understood the request from the OP.
Note that
(cons 10 (cdr (assoc 10 (entget (ssname ss i)))))is the same as:
(assoc 10 (entget (ssname ss i)))Hence, your code could become:
(defun c:test ( / i s ) (if (setq s (ssget '((0 . "POINT")))) (repeat (setq i (sslength s)) (entmake (list '(0 . "CIRCLE") '(40 . 1.0) (assoc 10 (entget (ssname s (setq i (1- i))))))) ) ) (princ) )Also, note that DXF Group 40 is the Circle radius, not diameter.
Correct!
My bad...
Henrique
Can't find what you're looking for? Ask the community or share your knowledge.