Jump to content

Custom rotate/scale


SstennizZ

Recommended Posts

I want to do the following:

When I draw a circle with the circle command I can choose 2p. If I click on the first point and move the cursor, a circle appears which scales and rotates depending on the movement of the circle. (Try it if you don't know what I mean)

I want to be able to do this, but then with a circle that has another circle within it that stays on an offset of 850. So I want to be able to have one fixed point and then see both circles moving with the cursor. The inner circle has to stay 850 from the outer and the fixed point needs to be in the outer. I wish I could show an example, but there's no way to do that..

 

Anybody here who can help me with this?

Link to comment
Share on other sites

Try this:

(defun c:test ()

 ;;  CAB version 1.0
 ;;  Calling routine to pass a center point & offset distance
 ;;  Routine will allow user to streatch outer circle
 ;;  Note if offset distance is a negative number the offset circle
 ;;  will be on the outside
 ;;
 ;;  Returns the distance to the 2nd pick point
 (defun ghostCircle (p1 r2 / *error* r1 c1 c2 el1 el2 gr rMin)
   (defun *error* (msg)
     (if (not
           (member msg '("Console break" "Function cancelled" "quit / exit abort" "" nil))
         )
       (princ (strcat "\nError: " msg))
     )
     (and c1 (entdel c1))
     (and c2 (entdel c2))
     (princ)
   )     ; end error function

   
   (setq rMin 0.001)
   (setq c1
          (entmakex (list (cons 0 "CIRCLE")
                          (cons 6 "BYLAYER")
                          (cons 8 "0")
                          (cons 10 p1)
                          (cons 39 0.0)
                          (cons 40 rMin) ; radius
                          (cons 62 256)
                          (cons 210 (list 0.0 0.0 1.0))
                    )
          )
   )
   (setq c2
          (entmakex (list (cons 0 "CIRCLE")
                          (cons 6 "BYLAYER")
                          (cons 8 "0")
                          (cons 10 p1)
                          (cons 39 0.0)
                          (cons 40 rMin) ; radius
                          (cons 62 256)
                          (cons 210 (list 0.0 0.0 1.0))
                    )
          )
   )
   (setq el1 (entget c1)
         el2 (entget c2)
   )
   (while (and (setq gr (grread 5)) (= (car gr) 5))
     (cond
       ((> (setq r1 (distance p1 (cadr gr))) rMin)
        (entmod (subst (cons 40 (distance p1 (cadr gr))) (assoc 40 el1) el1))
        (entupd (cdr (assoc -1 el1)))
        (cond
          ((> r1 (+ rMin r2))
           (entmod (subst (cons 40 (- r1 r2)) (assoc 40 el2) el2))
           (entupd (cdr (assoc -1 el2)))
          )
          (t ; minimize the inner circle
           (entmod (subst (cons 40 rMin) (assoc 40 el2) el2))
           (entupd (cdr (assoc -1 el2)))
          )
        )
       )
       (t ; minimize the outer circle
        (entmod (subst (cons 40 rMin) (assoc 40 el1) el1))
        (entupd (cdr (assoc -1 el1)))
       )
     )
   )
   (entdel c1)
   (entdel c2)
   r1
 )


 (setq pc (getpoint "\nPick center point."))
 (princ "\n Select new radius  ")
 (setq rad (ghostcircle pc 850.0)) ; center point & offset distance
 (princ rad)
 (princ)
)

Link to comment
Share on other sites

Try this:

(defun c:test ()

 ;;  CAB version 1.0
 ;;  Calling routine to pass a center point & offset distance
 ;;  Routine will allow user to streatch outer circle
 ;;  Note if offset distance is a negative number the offset circle
 ;;  will be on the outside
 ;;
 ;;  Returns the distance to the 2nd pick point
 (defun ghostCircle (p1 r2 / *error* r1 c1 c2 el1 el2 gr rMin)
   (defun *error* (msg)
     (if (not
           (member msg '("Console break" "Function cancelled" "quit / exit abort" "" nil))
         )
       (princ (strcat "\nError: " msg))
     )
     (and c1 (entdel c1))
     (and c2 (entdel c2))
     (princ)
   )     ; end error function

   
   (setq rMin 0.001)
   (setq c1
          (entmakex (list (cons 0 "CIRCLE")
                          (cons 6 "BYLAYER")
                          (cons 8 "0")
                          (cons 10 p1)
                          (cons 39 0.0)
                          (cons 40 rMin) ; radius
                          (cons 62 256)
                          (cons 210 (list 0.0 0.0 1.0))
                    )
          )
   )
   (setq c2
          (entmakex (list (cons 0 "CIRCLE")
                          (cons 6 "BYLAYER")
                          (cons 8 "0")
                          (cons 10 p1)
                          (cons 39 0.0)
                          (cons 40 rMin) ; radius
                          (cons 62 256)
                          (cons 210 (list 0.0 0.0 1.0))
                    )
          )
   )
   (setq el1 (entget c1)
         el2 (entget c2)
   )
   (while (and (setq gr (grread 5)) (= (car gr) 5))
     (cond
       ((> (setq r1 (distance p1 (cadr gr))) rMin)
        (entmod (subst (cons 40 (distance p1 (cadr gr))) (assoc 40 el1) el1))
        (entupd (cdr (assoc -1 el1)))
        (cond
          ((> r1 (+ rMin r2))
           (entmod (subst (cons 40 (- r1 r2)) (assoc 40 el2) el2))
           (entupd (cdr (assoc -1 el2)))
          )
          (t ; minimize the inner circle
           (entmod (subst (cons 40 rMin) (assoc 40 el2) el2))
           (entupd (cdr (assoc -1 el2)))
          )
        )
       )
       (t ; minimize the outer circle
        (entmod (subst (cons 40 rMin) (assoc 40 el1) el1))
        (entupd (cdr (assoc -1 el1)))
       )
     )
   )
   (entdel c1)
   (entdel c2)
   r1
 )


 (setq pc (getpoint "\nPick center point."))
 (princ "\n Select new radius  ")
 (setq rad (ghostcircle pc -10.0))
 (princ rad)
 (princ)
)

 

 

Ok, that kinda works, but I want to select a point on the outer circle, not the center.. and be able to rotate around that point.

Link to comment
Share on other sites

Sorry I left my last test offset in that code.

Change this line

(setq rad (ghostcircle pc -10.0))

to this

(setq rad (ghostcircle pc 850.0))

This will give you an outer circle offset by 850 units.

 

 

Perhaps I don't understand what you are after.

Are you wanting to pick a tangent point on the inner circle and then steatch to the

center point?

Link to comment
Share on other sites

Sorry I left my last test offset in that code.

Change this line

(setq rad (ghostcircle pc -10.0))

to this

(setq rad (ghostcircle pc 850.0))

This will give you an outer circle offset by 850 units.

 

 

Perhaps I don't understand what you are after.

Are you wanting to pick a tangent point on the inner circle and then steatch to the

center point?

 

I want to pick a tangent point on the outer circle and then stretch to a different tangent point. And be able to rotate around the first point.

Link to comment
Share on other sites

OK.

What is the relationship of the 2nd point to the radius of the circle?

one to one?

 

Euhh.. I don't know. Just try the thing I said in my first post. Circle, 2p, select a point en see what happens when you move your cursor.. ;) The circle traces your cursor and makes the circle bigger or rotate around the first point. Then you can select a second point. I want to do the same, but then with another circle visible within the outer circle. Its kinda hard to explain..

Link to comment
Share on other sites

Euhh.. I don't know. Just try the thing I said in my first post. Circle, 2p, select a point en see what happens when you move your cursor.. ;) The circle traces your cursor and makes the circle bigger or rotate around the first point. Then you can select a second point. I want to do the same, but then with another circle visible within the outer circle. Its kinda hard to explain..

 

You need to give more info, or some type of visual. Don't say you can't because with CAD there is a way to do/show everything.

Link to comment
Share on other sites

Euhh.. I don't know. Just try the thing I said in my first post. Circle, 2p, select a point en see what happens when you move your cursor.. ;) The circle traces your cursor and makes the circle bigger or rotate around the first point. Then you can select a second point. I want to do the same, but then with another circle visible within the outer circle. Its kinda hard to explain..

 

Oh, I see now. I never use the 2p option.

In that method the 2nd pick point is the diameter and opposite side of the circle.

I will revise the code after lunch. :)

Link to comment
Share on other sites

New version.

(defun c:test2 ()

 ;;  CAB version 1.1
 ;;  Calling routine to pass a tangent point (p1) & offset distance (od)
 ;;  Routine will allow user to stretch outer circle using diameter
 ;;  Note if offset distance is a negative number the offset circle
 ;;  will be on the outside
 ;;
 ;;  Returns the 2nd pick point
 (defun ghostCircle (p1 od / *error* p2 d1 c1 c2 el1 el2 gr rMin)
   (defun *error* (msg)
     (if (not
           (member msg '("Console break" "Function cancelled" "quit / exit abort" "" nil))
         )
       (princ (strcat "\nError: " msg))
     )
     (and c1 (entdel c1))
     (and c2 (entdel c2))
     (princ)
   )     ; end error function

   
   (setq rMin 0.001)
   (setq c1
          (entmakex (list (cons 0 "CIRCLE")
                          (cons 6 "BYLAYER")
                          (cons 8 "0")
                          (cons 10 p1)
                          (cons 39 0.0)
                          (cons 40 rMin) ; radius
                          (cons 62 256)
                          (cons 210 (list 0.0 0.0 1.0))
                    )
          )
   )
   (setq c2
          (entmakex (list (cons 0 "CIRCLE")
                          (cons 6 "BYLAYER")
                          (cons 8 "0")
                          (cons 10 p1)
                          (cons 39 0.0)
                          (cons 40 rMin) ; radius
                          (cons 62 256)
                          (cons 210 (list 0.0 0.0 1.0))
                    )
          )
   )
   (setq el1 (entget c1)
         el2 (entget c2)
   )
   ;;  p1 is a tangent point
   ;;  p2 is a tangent point with center at mid point of p1 p2
   (while (and (setq gr (grread 5)) (= (car gr) 5))
     (cond
       ((> (setq d1 (distance p1 (setq p2 (cadr gr)))) rMin)
        (setq el1 (subst (cons 40 (setq r1 (/ d1 2.))) (assoc 40 el1) el1))
        (setq el1 (entmod (subst (cons 10 (polar p1 (angle p1 p2) r1)) (assoc 10 el1) el1)))
        (entupd (cdr (assoc -1 el1)))
        (cond
          ((< rMin (- d1 od))
           (setq el2 (subst (cons 40 (- d1 (/ od 2.))) (assoc 40 el2) el2))
           (setq el2 (entmod (subst (assoc 10 el1) (assoc 10 el2) el2)))
           (entupd (cdr (assoc -1 el2)))
          )
          (t ; minimize the inner circle
           (setq el2 (subst (cons 40 rMin) (assoc 40 el2) el2))
           (setq el2 (entmod (subst (assoc 10 el1) (assoc 10 el2) el2)))
           (entupd (cdr (assoc -1 el2)))
          )
        )
       )
       (t ; minimize the outer circle
        (setq el1 (subst (cons 40 rMin) (assoc 40 el1) el1))
        (setq el1 (entmod (subst (cons 10 (polar p1 (angle p1 p2) (/ rMin 2.))) (assoc 10 el1) el1)))
        (entupd (cdr (assoc -1 el1)))
       )
     )
   )
   (entdel c1)
   (entdel c2)
   p2
 )


 (setq pc (getpoint "\nPick center point."))
 (princ "\n Select new radius  ")
 (setq rad (ghostcircle pc 850.0))
 (princ rad)
 (princ)
)

Link to comment
Share on other sites

New version.

 

Dude, looks good! But... The startpoint needs to be on the outer circle. And the offset of the inner circle must stay 850. Now when I make the circle bigger, the offset scales too. Is it possible to do this in your routine?

And last but not least, now it only visualises the circles. Is it possible to draw them too? o:):oops: Thanx for trying mate! I could have never come up with that routine on my own!

Link to comment
Share on other sites

You're welcome.

 

Change this

    (entdel c1)
   (entdel c2)

to this to keep the circles

    ; (entdel c1)
   ; (entdel c2)

 

And change this

  (setq rad (ghostcircle pc 850.0))

to this to switch point from inner to outer circle

  (setq rad (ghostcircle pc -850.0))

Link to comment
Share on other sites

You're welcome.

 

Change this

    (entdel c1)
   (entdel c2)

to this to keep the circles

    ; (entdel c1)
   ; (entdel c2)

And change this

  (setq rad (ghostcircle pc 850.0))

to this to switch point from inner to outer circle

  (setq rad (ghostcircle pc -850.0))

 

Ok, the entdel part worked, but changing the 850 to -850 for some reason doesn't.

And the offset of the inner circle must stay 850. Now when I make the circle bigger, the offset scales too.

Link to comment
Share on other sites

Oops, math error fixed. Try version 1.2

(defun c:test2 ()

 ;;  CAB version 1.2
 ;;  Calling routine to pass a tangent point (p1) & offset distance (od)
 ;;  Routine will allow user to stretch outer circle using diameter
 ;;  Note if offset distance is a negative number the offset circle
 ;;  will be on the outside
 ;;
 ;;  Returns the 2nd pick point
 (defun ghostCircle (p1 od / *error* p2 d1 c1 c2 el1 el2 gr rMin)
   (defun *error* (msg)
     (if (not
           (member msg '("Console break" "Function cancelled" "quit / exit abort" "" nil))
         )
       (princ (strcat "\nError: " msg))
     )
     (and c1 (entdel c1))
     (and c2 (entdel c2))
     (princ)
   )     ; end error function

   
   (setq rMin 0.001) ; Minimum Radius allowed
   (setq c1
          (entmakex (list (cons 0 "CIRCLE")
                          (cons 6 "BYLAYER")
                          (cons 8 "0")
                          (cons 10 p1)
                          (cons 39 0.0)
                          (cons 40 rMin) ; radius
                          (cons 62 256)
                          (cons 210 (list 0.0 0.0 1.0))
                    )
          )
   )
   (setq c2
          (entmakex (list (cons 0 "CIRCLE")
                          (cons 6 "BYLAYER")
                          (cons 8 "0")
                          (cons 10 p1)
                          (cons 39 0.0)
                          (cons 40 rMin) ; radius
                          (cons 62 256)
                          (cons 210 (list 0.0 0.0 1.0))
                    )
          )
   )
   (setq el1 (entget c1)
         el2 (entget c2)
   )
   ;;  p1 is a tangent point
   ;;  p2 is a tangent point with center at mid point of p1 p2
   (while (and (setq gr (grread 5)) (= (car gr) 5))
     (cond
       ((> (setq d1 (distance p1 (setq p2 (cadr gr)))) rMin)
        (setq el1 (subst (cons 40 (setq r1 (/ d1 2.))) (assoc 40 el1) el1))
        (setq el1 (entmod (subst (cons 10 (polar p1 (angle p1 p2) r1)) (assoc 10 el1) el1)))
        (entupd (cdr (assoc -1 el1)))
        (cond
          ((< rMin (- d1 (* od 2.)))
           (setq el2 (subst (cons 40 (/ (- d1 (* od 2.)) 2.)) (assoc 40 el2) el2))
           (setq el2 (entmod (subst (assoc 10 el1) (assoc 10 el2) el2)))
           (entupd (cdr (assoc -1 el2)))
          )
          (t ; minimize the inner circle
           (setq el2 (subst (cons 40 rMin) (assoc 40 el2) el2))
           (setq el2 (entmod (subst (assoc 10 el1) (assoc 10 el2) el2)))
           (entupd (cdr (assoc -1 el2)))
          )
        )
       )
       (t ; minimize the outer circle
        (setq el1 (subst (cons 40 rMin) (assoc 40 el1) el1))
        (setq el1 (entmod (subst (cons 10 (polar p1 (angle p1 p2) (/ rMin 2.))) (assoc 10 el1) el1)))
        (entupd (cdr (assoc -1 el1)))
       )
     )
   )
   ;(entdel c1) ; to remove the circle
   ;(entdel c2) ; to remove the circle
   p2
 )


 (setq pc (getpoint "\nPick center point."))
 (princ "\n Select new radius  ")
 (setq rad (ghostcircle pc 850.0))
 (princ rad)
 (princ)
)

Link to comment
Share on other sites

AWESOME! :P

Thanx a lot! This works great! Now all I need to do is figure out how to make it switch to a specific layer and back.

 

Ow and why can't I snap the second point and is it possible for the second point to be the center of the circles? 8) I know I'm a pain, but its for a greater good! o:):D

Link to comment
Share on other sites

Here with layer. Layer will be made is non existant.

Note that the grread does not support Osnap.

There is a rather lengthy routine to acomplist that.

But I can add a feature to snap without the symbols.

(defun c:test2 ()

 ;;  CAB version 1.3
 ;;  Calling routine to pass a tangent point (p1) & offset distance (od)
 ;;  Routine will allow user to stretch outer circle using diameter
 ;;  Note if offset distance is a negative number the offset circle
 ;;  will be on the outside
 ;;  LayName if nil will use the curent layer
 ;;  Returns the 2nd pick point
 (defun ghostCircle (p1 od LayName / *error* p2 d1 c1 c2 el1 el2 gr rMin)
   (defun *error* (msg)
     (if (not
           (member msg '("Console break" "Function cancelled" "quit / exit abort" "" nil))
         )
       (princ (strcat "\nError: " msg))
     )
     (and c1 (entdel c1))
     (and c2 (entdel c2))
     (princ)
   )     ; end error function

   
   (or layName (setq layName (getvar "clayer")))
   (setq rMin 0.001) ; Minimum Radius allowed
   (setq c1
          (entmakex (list (cons 0 "CIRCLE")
                          (cons 6 "BYLAYER")
                          (cons 8 LayName)
                          (cons 10 p1)
                          (cons 39 0.0)
                          (cons 40 rMin) ; radius
                          (cons 62 256)
                          (cons 210 (list 0.0 0.0 1.0))
                    )
          )
   )
   (setq c2
          (entmakex (list (cons 0 "CIRCLE")
                          (cons 6 "BYLAYER")
                          (cons 8 LayName)
                          (cons 10 p1)
                          (cons 39 0.0)
                          (cons 40 rMin) ; radius
                          (cons 62 256)
                          (cons 210 (list 0.0 0.0 1.0))
                    )
          )
   )
   (setq el1 (entget c1)
         el2 (entget c2)
   )
   ;;  p1 is a tangent point
   ;;  p2 is a tangent point with center at mid point of p1 p2
   (while (and (setq gr (grread 5)) (= (car gr) 5))
     (cond
       ((> (setq d1 (distance p1 (setq p2 (cadr gr)))) rMin)
        (setq el1 (subst (cons 40 (setq r1 (/ d1 2.))) (assoc 40 el1) el1))
        (setq el1 (entmod (subst (cons 10 (polar p1 (angle p1 p2) r1)) (assoc 10 el1) el1)))
        (entupd (cdr (assoc -1 el1)))
        (cond
          ((< rMin (- d1 (* od 2.)))
           (setq el2 (subst (cons 40 (/ (- d1 (* od 2.)) 2.)) (assoc 40 el2) el2))
           (setq el2 (entmod (subst (assoc 10 el1) (assoc 10 el2) el2)))
           (entupd (cdr (assoc -1 el2)))
          )
          (t ; minimize the inner circle
           (setq el2 (subst (cons 40 rMin) (assoc 40 el2) el2))
           (setq el2 (entmod (subst (assoc 10 el1) (assoc 10 el2) el2)))
           (entupd (cdr (assoc -1 el2)))
          )
        )
       )
       (t ; minimize the outer circle
        (setq el1 (subst (cons 40 rMin) (assoc 40 el1) el1))
        (setq el1 (entmod (subst (cons 10 (polar p1 (angle p1 p2) (/ rMin 2.))) (assoc 10 el1) el1)))
        (entupd (cdr (assoc -1 el1)))
       )
     )
   )
   ;(entdel c1) ; to remove the circle
   ;(entdel c2) ; to remove the circle
   p2
 )


 (setq pc (getpoint "\nPick center point."))
 (princ "\n Select new radius  ")
 (setq rad (ghostcircle pc 850.0 "0")) ; Layer name "0"

 (princ rad)
 (princ)
)

Link to comment
Share on other sites

So what do I have to change if I want the used layer to be "Hulplijnen"?

And if you could at least make it snap without the symbols, that whould be great!

Was it possible to change the second point from tangent to the center of the circle?

Link to comment
Share on other sites

Change to this line. I updated the code above.

  (setq rad (ghostcircle pc 850.0 "Hulplijnen")) ; Layer name "0"

 

I am adding the osnap to the next version but am also packing for a long weekend away & may not finish before i go.

Link to comment
Share on other sites

Little testing.

(defun c:test4 ()

 ;;  CAB version 1.4
 ;;  Calling routine to pass a tangent point (p1) & offset distance (od)
 ;;  Routine will allow user to stretch outer circle using diameter
 ;;  Note if offset distance is a negative number the offset circle
 ;;  will be on the outside
 ;;  LayName if nil will use the curent layer
 ;;  os when true will use the osnap if it is active
 ;;  Returns the 2nd pick point
 (defun ghostCircle (p1 od layName os / *error* get_osmode p2 d1 c1 c2 el1 el2 gr rMin)
   (defun *error* (msg)
     (if (not
           (member msg '("Console break" "Function cancelled" "quit / exit abort" "" nil))
         )
       (princ (strcat "\nError: " msg))
     )
     (and c1 (entdel c1))
     (and c2 (entdel c2))
     (princ)
   )     ; end error function
   
   ;;  CAB  10/5/2006
   ;;
   ;;  Function to return the current osmode setting in the form of a string
   ;;  If (getvar "osmode") = 175 
   ;;  (get_osmode)  returns   "_end,_mid,_cen,_nod,_int,_per"
   ;;  Usage
   ;;  (osnap (getpoint) (get_osmode))
   ;;
   (defun get_osmode (/ cur_mode mode$)
     (setq mode$ "")
     (if (< 0 (setq cur_mode (getvar "osmode")) 16383)
       (mapcar
         '(lambda (x)
            (if (not (zerop (logand cur_mode (car x))))
              (setq mode$ (strcat mode$ (cadr x)))
            ) )
         '((0 "_non,") (1 "_end,") (2 "_mid,") (4 "_cen,") (8 "_nod,") (16 "_qua,")
           (32 "_int,") (64 "_ins,") (128 "_per,") (256 "_tan,") (512 "_nea,")
           (1024 "_qui,") (2048 "_app,") (4096 "_ext,") (8192 "_par") )
       )
     )
     mode$
   )

   (defun CircleUpdate (p1 p2 od rMin el1 el2 / d1 gr c1 c2)
     (cond
       ((> (setq d1 (distance p1 p2)) rMin)
        (setq el1 (subst (cons 40 (setq r1 (/ d1 2.))) (assoc 40 el1) el1))
        (setq el1 (entmod (subst (cons 10 (polar p1 (angle p1 p2) r1)) (assoc 10 el1) el1)))
        (entupd (cdr (assoc -1 el1)))
        (cond
          ((< rMin (- d1 (* od 2.)))
           (setq el2 (subst (cons 40 (/ (- d1 (* od 2.)) 2.)) (assoc 40 el2) el2))
           (setq el2 (entmod (subst (assoc 10 el1) (assoc 10 el2) el2)))
           (entupd (cdr (assoc -1 el2)))
          )
          (t ; minimize the inner circle
           (setq el2 (subst (cons 40 rMin) (assoc 40 el2) el2))
           (setq el2 (entmod (subst (assoc 10 el1) (assoc 10 el2) el2)))
           (entupd (cdr (assoc -1 el2)))
          )
        )
       )
       (t ; minimize the outer circle
        (setq el1 (subst (cons 40 rMin) (assoc 40 el1) el1))
        (setq el1 (entmod (subst (cons 10 (polar p1 (angle p1 p2) (/ rMin 2.))) (assoc 10 el1) el1)))
        (entupd (cdr (assoc -1 el1)))
       )
     )
     p2
   )

   (or layName (setq layName (getvar "clayer")))
   (setq rMin 0.001) ; Minimum Radius allowed
   (setq c1
          (entmakex (list (cons 0 "CIRCLE")
                          (cons 6 "BYLAYER")
                          (cons 8 layName)
                          (cons 10 p1)
                          (cons 39 0.0)
                          (cons 40 rMin) ; radius
                          (cons 62 256)
                          (cons 210 (list 0.0 0.0 1.0))
                    )
          )
   )
   (setq c2
          (entmakex (list (cons 0 "CIRCLE")
                          (cons 6 "BYLAYER")
                          (cons 8 layName)
                          (cons 10 p1)
                          (cons 39 0.0)
                          (cons 40 rMin) ; radius
                          (cons 62 256)
                          (cons 210 (list 0.0 0.0 1.0))
                    )
          )
   )
   (setq el1 (entget c1)
         el2 (entget c2)
   )
   ;;  p1 is a tangent point
   ;;  p2 is a tangent point with center at mid point of p1 p2
   (while (and (setq gr (grread 5)) (= (car gr) 5))
     (setq p2 (CircleUpdate p1 (cadr gr) od rMin el1 el2))
   )
   ;(entdel c1) ; to remove the circle
   ;(entdel c2) ; to remove the circle
   (setq p2 (if os (osnap p2 (get_osmode))p2))
   (or p2 (setq p2 (cadr gr))) ; catch any error with point
   (CircleUpdate p1 p2 od rMin el1 el2)
   p2
 )


 (setq pc (getpoint "\nPick center point."))
 (princ "\n Select new radius  ")
 (setq rad (ghostcircle pc 850.0 "0" t)) ; Layer name "0", t= use osmode if on
 (princ rad)
 (princ)
)

Link to comment
Share on other sites

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...