Jump to content

Predifined scale/size of circles


Recommended Posts

Posted

Dear Xperts!

 

Is there any predifined scale command available in acad?

4 ex :I want 10 circles with the dimension of 30mm. without no copy and other commands ...

 

hope understand and Help me

Posted

Watch your command line. After you create the first circle, with the diameter of 30mm, the next circle you draw will default to the previous diameter you entered. You don't have to enter the dimension every time.

 

Why don't you want to use the Copy command or Array or Measure? It's faster than creating and placing each circle individually.

Posted

if all of your drawings will always contain several 30mm circles, it may be beneficial to create them as a block and create a keyboard shortcut to 'insert circle block'

 

if that's not a suitable answer, some more explanation may be useful

Posted

Quickest thing I could think of :P

 

(defun c:qcir (/ tmp pt)
 (or def@rad (setq def@rad 1.))
 (initget 6)
 (or
   (not
     (setq tmp
       (getdist
         (strcat "\nSpecify Radius of Circle <" (rtos def@rad) "> : "))))
   (setq def@rad tmp))  
 (while (setq pt (getpoint "\nPick for Circle: "))
   (entmake
     (list
       (cons 0 "CIRCLE")
       (cons 10 pt)
       (cons 40 def@rad))))
 (princ))

Posted

Or, a dynamic Version!

 

(defun c:mycircle (/ *error* inc msg gr lst i tmp)
 (vl-load-com)

 (defun *error* (msg)
   (redraw)
   (if (not (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*"))
     (princ (strcat "\n<< Error: " msg " >>"))
     (princ "\n*Cancel*"))
   (princ))
 
 (or *Cir$Dia* (setq *Cir$Dia* 24.)) ; Initial Diameter
 (setq Inc 2.)  ; Increment
 
 (princ (setq msg "\n<< Position Circle [+] or [-] to Change [D]iameter >>"))
 (while
   (progn
     (setq gr (grread t 15 0))
     (redraw)
     (cond ((and (eq 5 (car gr)) (listp (cadr gr)))
            (setq lst nil i 0)
            (repeat 300
              (setq lst
                (cons
                  (polar (cadr gr)
                         (* i (/ pi 150.))
                         (/ *Cir$Dia* 2.)) lst) i (1+ i)))
            (grvecs (append '(30) lst (cdr lst) (list (car lst)))) t) ; Keep in Loop
           ((eq 3 (car gr))
            (entmakex
              (list
                (cons 0 "CIRCLE")
                (cons 10 (cadr gr))
                (cons 40 (/ *Cir$Dia* 2.)))))
           ((eq 25 (car gr))
            (princ "\n<< User Quit >>") nil) ; Exit Loop
           ((eq 2 (car gr)) ; Keyboard input
            (cond ((vl-position (cadr gr) '(61 43)) ; +
                   (setq *Cir$Dia* (+ Inc *Cir$Dia*)))
                  ((eq 45 (cadr gr)) ; -
                   (if (> *Cir$Dia* Inc)
                     (setq *Cir$Dia* (- *Cir$Dia* Inc))
                     (progn
                       (princ "\n<< Minimum Circle Diameter Reached >>")
                       (princ msg))))
                  ((vl-position (cadr gr) '(13 32))
                   (princ "\n<< User Quit >>") nil) ; Exit Loop
                  ((vl-position (cadr gr) '(68 100)) ; D/d
                   (initget 6)
                   (if (setq tmp (getreal "\nSpecify Diameter: "))
                     (setq *Cir$Dia* tmp))))))))

 (redraw)
 (princ))

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...