mauro Posted August 22, 2008 Share Posted August 22, 2008 how can i to select objects inside a circle? thanks Quote Link to comment Share on other sites More sharing options...
Cad64 Posted August 22, 2008 Share Posted August 22, 2008 You mean other than clicking on them? Could you be a little more specific about what you're trying to do? Are you trying to only select specific types of objects, or do you want to select only objects that are on a certain layer or a certain color? More information would be helpful. Quote Link to comment Share on other sites More sharing options...
mauro Posted August 22, 2008 Author Share Posted August 22, 2008 for eg: in the attached file, i need to count the entities what are drawing inside the big circle. Dibujo1.dwg Quote Link to comment Share on other sites More sharing options...
smorales02 Posted August 22, 2008 Share Posted August 22, 2008 I am confused.... Why cant you just count them by looking at it or just select them??? Quote Link to comment Share on other sites More sharing options...
mauro Posted August 22, 2008 Author Share Posted August 22, 2008 that's an example, in the real case there are about 14000 entities in diferent circle areas. see the attached file, that's the real case. i need to know how many entities are in circle A; B; C; ... Quote Link to comment Share on other sites More sharing options...
mauro Posted August 22, 2008 Author Share Posted August 22, 2008 sorry. here is the file Dibujo2.dwg Quote Link to comment Share on other sites More sharing options...
smorales02 Posted August 22, 2008 Share Posted August 22, 2008 Can you do a selection window that enlcoses the circle than remove the circle from the selction and in your properties it should tell you how many entities there are.... Quote Link to comment Share on other sites More sharing options...
smorales02 Posted August 22, 2008 Share Posted August 22, 2008 I see your dillemma now...give me a min and let me see what I can come up with Quote Link to comment Share on other sites More sharing options...
mauro Posted August 22, 2008 Author Share Posted August 22, 2008 thanks. i must to leave the office now. but i wait for your help. Quote Link to comment Share on other sites More sharing options...
smorales02 Posted August 22, 2008 Share Posted August 22, 2008 I dont have any easy fix for it but im sure someone with more knowledge can come up with something Quote Link to comment Share on other sites More sharing options...
cadmando Posted August 22, 2008 Share Posted August 22, 2008 There are 3274 items, use a right to left crossing window to select everything in the drawing, press and hold the shift key and select the circles and text, this will deselect them, this should leave you with 3274 objects selected. Hope this is of help Graham Quote Link to comment Share on other sites More sharing options...
cadmando Posted August 22, 2008 Share Posted August 22, 2008 There are 3286 objects in the drawing, less 6 text objects and 6 circles, which leaves you with 3274 objects. Use a right to left crossing window to select all objects in the drawing, press and hold the shift key, click on the circles and each text object, your count should equal 3274. Hope this is of help Regards Graham Quote Link to comment Share on other sites More sharing options...
haya Posted August 22, 2008 Share Posted August 22, 2008 There are 3274 items, use a right to left crossing window to select everything in the drawing, press and hold the shift key and select the circles and text, this will deselect them, this should leave you with 3274 objects selected. Hope this is of help Graham Using (LIST) command , select the object inside circle then the number of the selected object appear in the dialog Haya Quote Link to comment Share on other sites More sharing options...
smorales02 Posted August 22, 2008 Share Posted August 22, 2008 I think he needs the individual numbers per circle...in other words how many are within Circle A, B, C etc Quote Link to comment Share on other sites More sharing options...
fuccaro Posted August 23, 2008 Share Posted August 23, 2008 It can be worked out with a Lisp routine. But first: are the small circles everytime so small? can we say that you want to count circles with diameter under 1, placed inside circles with diameter >1? With other words: if we use a program, we must use a criteria to separe the circles to be counted and the border-circles. Oh, and one more thing: the objects to be counted are all circles? and if a circle intersects a border, do you wish to be considered an insider object? Quote Link to comment Share on other sites More sharing options...
hay123 Posted August 23, 2008 Share Posted August 23, 2008 Where did the point/circle data come from, and how was it entred into cad. If you have it in excel or something, perhaps it could be sorted into points that are within a certian coordinate range for each circle. Otherwise, all I can think is to create new layers 'a', 'b', 'c', 'd', with different colours so they're easier to see, maybe even make the circles bigger, and go through selecting groups within each circle and re-layering. There is probably a better way, but this will work, and I think take less than 1/2hr. You may want to check you have selected all circle correctly, by adding up the 'a's b's c's d's to make sure you have them all. if your missing a few they will be on original layer and be easy to find any re-place. Quote Link to comment Share on other sites More sharing options...
fuccaro Posted August 25, 2008 Share Posted August 25, 2008 (defun c:count( / borders objects ib io r1 c1 c2 nr) ; Counts small circles (r<1)) inside circular borders. ; Aug 2008 mfuccaro@hotmail.com ; (setq borders (ssget "X" (list '(0 . "CIRCLE") '(-4 . ">") (cons 40 1.0)))) (setq objects (ssget "X" (list '(0 . "CIRCLE") '(-4 . "<") (cons 40 1.0)))) (if (null borders) (progn (alert "No borders. Exiting") (exit))) (repeat (setq ib (sslength borders)) (setq r1 (cdr (assoc 40 (entget (ssname borders (setq ib (1- ib)))))) c1 (cdr (assoc 10 (entget (ssname borders ib)))) nr 0) (princ (strcat "\nBorder " (itoa (- (sslength borders) ib)) "\tRadius=" (rtos r1))) (if (not (null objects)) (repeat (setq io (sslength objects)) (setq c2 (cdr (assoc 10 (entget (ssname objects (setq io (1- io))))))) (if (>= r1 (distance c1 c2)) (setq nr (1+ nr))) ) ) (princ (strcat "\tsmall circles inside=" (itoa nr))) ) (textscr) (princ) ) Quote Link to comment Share on other sites More sharing options...
CALCAD Posted August 25, 2008 Share Posted August 25, 2008 Mauro. Fuccaro has written an elegant program that is specific to your task. My program is not so elegant, but might be more generally applied. ;CWS.LSP - circular window selection : selects objects within existing circle (2D). ; Selected objects are highlighted and counted. ; Access selection with 'P' option of subsequent commands. (defun cws_error (msg) (setq *error* sys_error) (setvar "OSMODE" osave) (command "UCS" "R" "SYSUCS") (command "UCS" "D" "SYSUCS") (princ "\r") (setvar "CMDECHO" 1) (redraw) (setq ess nil) (princ) ) (defun c:cws (/ cir cn cel cc crad poly egp plst pc ptlist plst ec slen ssen n) (setvar "CMDECHO" 0) (setq sys_error *error*) (setq *error* cws_error) (setq osave (getvar "OSMODE")) (setvar "OSMODE" 0) (command "UCS" "S" "SYSUCS") (command "UCS" "") (setq cir (entsel "\nPick enclosing circle")) (setq cn (car cir)) (setq cel (entget cn)) (setq cc (cdr (assoc 10 cel))) (setq crad (cdr (assoc 40 cel))) (command ".POLYGON" 120 cc crad) (setq poly (entlast)) (setq egp (entget poly)) (setq plst (- (length egp) (length (member (assoc 10 egp) egp)))) (setq ptlist nil) (setq pc plst) (setq plst (- (length egp) 1)) (while (< pc plst) (setq ec (nth pc egp)) (setq ec (cdr ec)) (setq ptlist (cons ec ptlist)) (setq pc (+ pc 4)) ) (entdel (entlast)) (setq ess (ssget "WP" ptlist)) (redraw) (setq slen (sslength ess)) (setq n 0) (repeat slen (setq ssen (ssname ess n)) (redraw ssen 3) (setq n (+ n 1)) ) (setvar "OSMODE" osave) (command "UCS" "R" "SYSUCS") (command "UCS" "D" "SYSUCS") (princ "\r") (princ "\n ")(princ slen)(princ " objects selected") (setvar "CMDECHO" 1) (setq ess nil) (setq *error* sys_error) (princ) ) Quote Link to comment Share on other sites More sharing options...
fuccaro Posted August 26, 2008 Share Posted August 26, 2008 It seems that Mauro has no time to answer us. (S)He visited this forum earlier today, but possible forgot to leave an answer... Quote Link to comment Share on other sites More sharing options...
lpseifert Posted August 26, 2008 Share Posted August 26, 2008 While we're on the subject... as a mental exercise I tried to write an app for this; It would work, then it wouldn't.... it returns error: bad argument type: lselsetp nil If someone has the time/inclination could you take a look to see what the bug is? ;;-------------------------------------------------------------------- ;; get pline vertex list for LWPline only by CAB (defun get_pline_cor (elst) (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= 10 (car x))) elst) ) ) ;;---------------------------------------------------------------------------- (defun c:CountInCircle (/ circ pt_on circle_list pt_center circle_radius vertex_list ) (setq old_echo (getvar "cmdecho")) (setvar "cmdecho" 0) (setq circ (entsel "Select a circle: ") pt_on (osnap (cadr circ) "nea") circle_list (entget (car circ)) pt_center (cdr (assoc 10 circle_list)) circle_radius (cdr (assoc 40 circle_list)) ) (command "_polygon" 360 pt_center "I" circle_radius) (setq elst (entget (entlast)) ) (entdel (entlast)) (setq vertex_list (get_pline_cor elst) ) (alert (strcat "There are " (itoa (sslength (ssget "_WP" vertex_list '((0 . "circle")(8 . "Clientes"))))) " objects inside the circle" ) ) (setvar "cmdecho" old_echo) (princ) ) Thanks- Larry Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.