Circles in drawing and arc radii

Circles in drawing and arc radii

rmishmash
Participant Participant
985 Views
2 Replies
Message 1 of 3

Circles in drawing and arc radii

rmishmash
Participant
Participant
I have a flat pattern of a conveyor belt that is a segment of an circle with several holes in it. I am trying to do two things. First, I want to count the number of holes in the drawing. All holes are the same size. In AutoCAD this is fairly easy (although multiple steps). I know that if I use 'SELECT' and then 'FILTER' to only select circles, I get the answer. I originally wanted to create a custom button that would run through this, but found that a LISP routing was probably needed. Second, I am trying to select all (2 total) arcs larger than 1" radius and view the radii of each. Again, in AutoCAD, If I use 'LIST' and then filter to arcs larger than 1", I get the desired result. Again, I started to put the commands in a custom button, but probably need a LISP routine. Any help will be appreciated.
0 Likes
Accepted solutions (1)
986 Views
2 Replies
Replies (2)
Message 2 of 3

Ranjit_Singh
Advisor
Advisor
Accepted solution

Not sure if this is what you are looking for. This will select all circles with a radius of, for example, 3.5 in modelspace

(defun c:somefunc  (/ ss1)
 (setq ss1 (ssget "_x" '((0 . "circle") (410 . "Model") (-4 . "=") (40 . 3.5))))
 (sssetfirst () ss1)
 (sslength ss1))

This will select all arcs with their radii greater than 1 in modelspace

 

(defun c:somefunc2  (/ ss1)
 (setq ss1 (ssget "_x" '((0 . "arc") (410 . "Model") (-4 . ">") (40 . 1))))
 (command "._list" ss1 "")
  (sssetfirst () ss1))
Message 3 of 3

rmishmash
Participant
Participant

This does exactly what I need. Thank you for the assistance. I don't have the need very often, but I really need to learn LISP so I can do these things when needed.

0 Likes