Jimforbz Posted June 30, 2009 Posted June 30, 2009 Hi I'm a newbie to this forum but was wondering if anyone has had the same problem.. Background - I've written a quick lisp to try and automate a common task I regularly undertake. Basically I draw a circle by drawing 3 circles from 3 known points, that is to say, if you are in a room and want to draw a circular column the easiest way I can find to do it is circle with 3 tangent points - (measuring diameter or circumference using hand held instruments is often very inaccuarte in the built envirmonment). The problem is when you set the OSMODE to 256 for some reason it wont allow you to pick tangent points!! - at least not the ones I want to pick and definitely not the same as are available when you use the circle command outside of lisp. I've even tried re-setting it each time I need to pick a tangent point. Please can anyone help. Many thanks in advance. P.S. Here is the code I have come up with... (please note: I have yet to work on a way of deleting the initial circles and I would also need to enter the measured distances to the column as a record of my site work - but first - I need to find out why the tangent wont work!!) (defun c:column () (setq oldcmdecho (getvar "cmdecho")) (setvar "cmdecho" 0) (setq oldosmode (getvar "osmode")) (setvar "osmode" 35) (setq oldcmddia (getvar "cmddia")) (setvar "cmddia" 0) (princ "n\ Draws circular column using 3 reference points") ;draw initial 3 circles using user input (initget 1)(setq orig1pt (getpoint "\n Select origin of measurement...")) (setq circ1rad (getreal "\n Input distance from disto...")) (command "circle" orig1pt circ1rad ) (initget 1)(setq orig2pt (getpoint "\n Select origin of measurement...")) (setq circ2rad (getreal "\n Input distance from disto...")) (command "circle" orig2pt circ2rad ) (initget 1)(setq orig3pt (getpoint "\n Select origin of measurement...")) (setq circ3rad (getreal "\n Input distance from disto...")) (command "circle" orig3pt circ3rad ) ;draw column with 3 tangent points (setvar "osmode" 256) (initget 1)(setq col1pt1 (getpoint "\n Select tangent on first circle nearest where column will be placed...")) (setvar "osmode" 256) (initget 1)(setq col1pt2 (getpoint "\n Select tangent on second circle nearest where column will be placed...")) (setvar "osmode" 256) (initget 1)(setq col1pt3 (getpoint "\n Select tangent on third circle nearest where column will be placed...")) (command "circle" "3p" col1pt1 col1pt2 col1pt3 ) (setvar "osmode" oldosmode ) (setvar "cmdecho" oldcmdecho ) (setvar "cmddia" oldcmddia) (princ) ) Quote
CAB Posted June 30, 2009 Posted June 30, 2009 Would you post a DWG showing the Before, During & After of the method you want. I am having a tough time picturing what you are doing. Quote
BlackAlnet Posted July 1, 2009 Posted July 1, 2009 I think, the problem is: you dont have a reference point. Quote
Jimforbz Posted July 2, 2009 Author Posted July 2, 2009 I have attached an exmaple dwg as requested. measuring columns on site.dwg Quote
CAB Posted July 6, 2009 Posted July 6, 2009 This is version 1 & needs more work, but shows how it can be done with trial & error. ;; CAB Version 1.0 The Sledge Hammer Approach ;; Perhaps someone with a math background can apply the Math solution ;; http://demonstrations.wolfram.com/CirclesOfApollonius/ ;; http://www.geometryexpressions.com/downloads/Circles.pdf example 86 (defun c:GetColumn (/ p1 p2 p3 r1 r2 r3 c1 c2 c3 rbase rinc fuzz cpt pts_c1_c2 pts_c2_c3 pts_c1_c3) (vl-load-com) (defun MakeCircle (cpt rad lay) (entmakex (list (cons 0 "CIRCLE") (cons 6 "BYLAYER") (cons 8 "0") (cons 10 cpt) (cons 39 0.0) (cons 40 rad) ; radius (cons 62 256) (cons 210 (list 0.0 0.0 1.0)) ) ) ) ;; return 2 points in a list (defun getinters (obj1 obj2) (setq iplist (vl-catch-all-apply 'vlax-safearray->list (list (vlax-variant-value (vla-intersectwith obj1 obj2 acextendnone) ) ) ) ) (if (vl-catch-all-error-p iplist) ; error if no intersection nil (list (list (car iplist)(cadr iplist))(list (cadddr iplist)(nth 4 iplist))) ) ) (if (or p1 ; debug (and (setq p1 (getpoint "\nPick First circle center point.")) (setq r1 (getdist "\nEnter distance to column.") rx1 r1) (setq p2 (getpoint "\nPick Second circle center point.")) (setq r2 (getdist "\nEnter distance to column.") rx2 r2) (setq p3 (getpoint "\nPick Third circle center point.")) (setq r3 (getdist "\nEnter distance to column.") rx3 r3) ) ) (progn (setq r1 rx1 r2 rx2 r3 rx3) ; debug (setq rbase r1 rinc 0.01 ; step size fuzz 0.01) (setq c1 (vlax-ename->vla-object (MakeCircle p1 r1 "0"))) (setq c2 (vlax-ename->vla-object (MakeCircle p2 r2 "0"))) (setq c3 (vlax-ename->vla-object (MakeCircle p3 r3 "0"))) (while (progn (vla-put-radius c1 (setq r1 (+ r1 rinc))) (vla-put-radius c2 (setq r2 (+ r2 rinc))) (vla-put-radius c3 (setq r3 (+ r3 rinc))) (cond ((null (setq pts_c1_c2 (getinters c1 c2))) (prompt "\nC1 & C2 do not intersect.") ) ((null (setq pts_c2_c3 (getinters c2 c3))) (prompt "\nC2 & C3 do not intersect.") ) ((null (setq pts_c1_c3 (getinters c1 c3))) (prompt "\nC1 & C3 do not intersect.") ) ;; if 3 of the 6 points are the same the center has been found ;; check the first 2 point pair against the remaining two pair ((vl-some '(lambda(x) ; 5.77522 (and (or (equal x (car pts_c2_c3) fuzz) (equal x (cadr pts_c2_c3) fuzz)) (or (equal x (car pts_c1_c3) fuzz) (equal x (cadr pts_c1_c3) fuzz)))) pts_c1_c2) (MakeCircle (car pts_c1_c2) (- r1 rbase) "0") nil ; exit loop ) (t t) ) ) ) ) ) (princ) ) Quote
Jimforbz Posted July 14, 2009 Author Posted July 14, 2009 Hi CAB Thanks for your response and applogies for my delay (I was away last week). I have treid to experiment with the mathematics but my knowledge is stumbling over re-arrangeing the complex quadratics you get when trying to manipulate cartesain coordinates. I know there must be a way of solving this as AuotCAD already contains this cabability. However, the how is beyond me. I realise now that getpoint only stores a point not the tangent data connected to a point around an arc or circle. Anyway, many thanks for your input and the links (they were very helpful - I also found 'ttt.zip' before I blogged here which tries to use the same principle) but I think I'll have to go away and give this some more detailed thought/maths and perhaps googe it up some more. ttt.zip Quote
ronjonp Posted July 14, 2009 Posted July 14, 2009 Here is something to help place the circle...if you don't mind the accuracy being with 1\100 then it should work fine. All those geometry problems made my head hurt so I took a brute method like CAB ;;; AUTHOR ;;; Copyright© 2009 Ron Perez (ronperez (AT) gmail dot com) ;;; (defun c:tancir (/ c1 c2 c3 cen circle d1 d2 d3 fuzz p rad ss) (vl-load-com) (princ "\nSelect 3 circles...") (if (and (setq ss (ssget '((0 . "CIRCLE")))) (setq c1 (ssname ss 0)) (setq c2 (ssname ss 1)) (setq c3 (ssname ss 2)) (setq fuzz 0.01) ) (while (and (setq p (grread 5)) (= (car p) 5) (setq cen (trans (cadr p) 1 0))) (redraw) (grdraw cen (setq d1 (vlax-curve-getclosestpointto c1 cen)) 1) (grdraw cen (setq d2 (vlax-curve-getclosestpointto c2 cen)) 2) (grdraw cen (setq d3 (vlax-curve-getclosestpointto c3 cen)) 3) (setq rad (/ (apply '+ (list (distance cen d1) (distance cen d2) (distance cen d3))) 3.)) (if circle (entdel circle) ) (setq circle (entmakex (list '(0 . "CIRCLE") '(6 . "BYLAYER") '(8 . "0") (cons 10 cen) '(39 . 0.0) (cons 40 rad) ; radius '(62 . 256) (cons 210 (list 0.0 0.0 1.0)) ) ) ) (if (and (equal rad (distance cen d1) fuzz) (equal rad (distance cen d2) fuzz) (equal rad (distance cen d3) fuzz) ) (progn (grdraw cen (vlax-curve-getclosestpointto c1 cen) 5) (grdraw cen (vlax-curve-getclosestpointto c2 cen) 5) (grdraw cen (vlax-curve-getclosestpointto c3 cen) 5) ) ) (princ) ) ) ) Quote
CALCAD Posted July 31, 2009 Posted July 31, 2009 Here is my belated response to the tangency problem posed by Jimforbz . Investigation of this problem led me through some ancient and recent history that examined some of the various solutions to the Apollonius tangency problem. This program solves one kind of tangency that is just a small part of the general problem of finding all the circles mutually tangent to three given circles. It was a lot of fun to write and test. There are actually two programs. Please read all the notes prefacing the code before running. Enjoy. ; aic.lsp - Apollonius InCircle tangency solution in 2D ; using the intersection of hyperbolic arcs. ; 7-31-09 Working version by CALCAD ; There is a small companion program DAIC that deletes all the entities ; generated by AIC. When AIC runs, it creates a new layer (AIC) if it ; doesn't exist. That layer persists, but it will be empty after DAIC ; is run. ; ***************************************************************************** ; pseudocode - ; Pick three surrounding circles. ; From two of the circles, generate centers of tangent virtual circles ; by intersections of stepped radii from circle centers. ; The centers of virtual circles mutually tangent to the picked pair of circles ; are points on a hyperbolic arc. ; By picking another pair of the three surrounding circles, another set ; of points that lie on a second hyperbolic arc are generated. ; By picking the last pair of surrounding circles and generating the points, ; a third hyperbolic arc is approximated. ; The intersection of these arcs is the center of the incircle tangent ; to the three surrounding circles. ; Only two arcs are necessary to get an intersection, the third confirms ; the intersection. ; The radius of the incircle is defined by subtracting the radius of any ; of the surrounding circles from the length of a line drawn from the ; center of that circle to the intersection of the arcs. ; ***************************************************************************** ; Notes : ; Three circles are required to generate the hyperbolic arcs. The circles may ; overlap. ; The program generates red, green and cyan hyperbolas and the point sets are ; displayed to make the location of the intersection point (as described below) ; a little easier. And the colorful hyperbolas are pretty to look at! ; The hyperbolas are approximated by line segments and a little work is required ; of the user to finally produce the incircle. After the program finishes, zoom in ; on the intersection to clearly see it and any nearby points. The intersection of ; the lines is the location of the center of the incircle. Turn all snaps off except ; 'intersection' and if a point is nearby, be careful to avoid snapping to it ; because there is an intersection of the line segment endpoints at that point also. ; Turn on the 'center' snap. Draw a line between the crossing intersection and the ; center of the largest of the picked circles. Then draw a circle centered on the ; crossing intersection point and get the radius by snapping to the intersection of ; the line just drawn (to the center of the picked circle) with the picked circle ; itself. ; The resulting circle is mutually tangent to the three picked circles. ; Some arrangements of circles of varying diameter can produce two intersections ; of the arcs. In that case, there are two circles that are mutually tangent to ; the three picked circles. ; Sometimes the hyperbolas are not drawn out far enough to produce an intersection. ; Only two crossing hyperbolas are needed for an intersection, but sometimes all ; three fall short. If this happens, use DAIC to delete the entities produced by ; AIC, then zoom in on the area where the incircle will be. If you zoom in too far, ; one or more of the circles will be off the screen. You need to be able to pick all ; three circles. Try running AIC again. ; ; If there is still no intersection, there are three lines in the main program, ; normally commented out, that increase the length of the tails of the hyperbolas. ; These lines are at the beginning of each of the differently colored arc generating ; sections, e.g. ;; RED ARC ;(setq cnt 200) ; set special count, usually for arc extension ; Remove the semicolon from the ' ;(setq cnt 200) ' to extend that hyperbola. ; Reload the modified lisp and run it again. Remember to replace the semicolon(s) in ; the code since the extended hyperbolas take longer to generate and are clumsier to ; manage on the screen than the normal ones. ; There are purely mathematical solutions to the Apollonius tangency problem that ; involve solving a lot of simultaneous equations and then solving a lot of ; quadratics. I have tried to understand these solutions, so far without success. ; But I have not given up. Someday I hope to write a lisp that produces the solution ; to all eight circles, internally and externally tangent. (defun cinaic (accntr acrad ac2cntr ac2rad /) (setq cca (angle ac2cntr accntr)) (setq cthr_1 (/ (- (+ (* ctoc ctoc) (* ac2rad ac2rad)) (* acrad acrad)) (* 2 (* ctoc ac2rad)))) (if (< cthr_1 1) (progn (setq thr_1 (- (/ pi 2) (* 2 (atan (/ cthr_1 (+ 1 (sqrt (- 1 (* cthr_1 cthr_1))))))))) (setq tint1 (polar ac2cntr (+ (* thr_1 -1) cca) ac2rad)) (setq xint1 (car tint1)) (setq yint1 (cadr tint1)) (setq tint2 (polar ac2cntr (+ thr_1 cca) ac2rad)) (setq xint2 (car tint2)) (setq yint2 (cadr tint2)) (command "_.POINT" (list xint1 yint1 0)) (command "_.POINT" (list xint2 yint2 0)) (setq haptlst_a (cons (list xint1 yint1 0) haptlst_a)) (setq haptlst_b (cons (list xint2 yint2 0) haptlst_b)) ) ) ) (defun c:aic (/ *ERROR* syscolor syssize syspdmode syslayer cset n cpk cname cent1 c1ctr c1rad cent2 cnt c2ctr c2rad cent3 c3ctr c3rad radcc1 radcc2 radcc3 mtcrad ctoc haptlst_a haptlst_b) (defun *ERROR* (msg) (setvar "cecolor" syscolor) (setvar "pdsize" syssize) (setvar "pdmode" syspdmode) (setvar "CLAYER" syslayer) (setvar "CMDECHO" 1) (setq cset nil) (princ) ) (setq syscolor (getvar "cecolor")) (setq syssize (getvar "pdsize")) (setq syspdmode (getvar "pdmode")) (setvar "CMDECHO" 0) (setvar "pdsize" -0.25) (setq cset (ssadd)) (setq n 1) (setq cpk nil) (while (< n 4) (while (= cpk nil) (setq cpk (entsel "\n Pick each surrounding circle")) (princ "\r") (if (/= cpk nil) (progn (setq cpk (car cpk)) (redraw cpk 3) (ssadd cpk cset) ) ) ) (setq cpk nil) (setq n (+ n 1)) ) (redraw) (setq cname (ssname cset 0)) (setq cent1 (entget cname)) (setq c1ctr (cdr (assoc 10 cent1))) (setq c1rad (cdr (assoc 40 cent1))) (setq cname (ssname cset 1)) (setq cent2 (entget cname)) (setq c2ctr (cdr (assoc 10 cent2))) (setq c2rad (cdr (assoc 40 cent2))) (setq cname (ssname cset 2)) (setq cent3 (entget cname)) (setq c3ctr (cdr (assoc 10 cent3))) (setq c3rad (cdr (assoc 40 cent3))) (setq ctoc (distance c1ctr c2ctr)) (setq mtcrad (/ (- ctoc (+ c1rad c2rad)) 2)) (if (< mtcrad (* (getvar "VIEWSIZE") 0.005)) (setq mtcrad (* (getvar "VIEWSIZE") 0.02)) ) (setq cnt (* (/ 1 mtcrad) 500)) (if (< cnt 50) (setq cnt 50) ) (if (> cnt 350) (setq cnt 350) ) (setq n 1) (setq syslayer (getvar "CLAYER")) (command "_.LAYER" "M" "AIC" "") ;; RED ARC ;(setq cnt 200) ; set special count, usually for arc extension (while (< n cnt) (setq radcc1 (+ c1rad mtcrad)) (setq radcc2 (+ c2rad mtcrad)) (setvar "cecolor" "red") (cinaic c1ctr radcc1 c2ctr radcc2) (setq mtcrad (* 1.02 mtcrad)) (setq n (+ n 1)) ) (command "_.LINE" haptlst_a "") (command "_.LINE" haptlst_b "") (setq haptlst_a ()) (setq haptlst_b ()) (setq ctoc (distance c2ctr c3ctr)) (setq mtcrad (/ (- ctoc (+ c2rad c3rad)) 2)) (if (< mtcrad (* (getvar "VIEWSIZE") 0.005)) (setq mtcrad (* (getvar "VIEWSIZE") 0.02)) ) (setq cnt (* (/ 1 mtcrad) 500)) (if (< cnt 50) (setq cnt 50) ) (if (> cnt 350) (setq cnt 350) ) (setq n 1) ;; GREEN ARC ;(setq cnt 200) ; set special count, usually for arc extension (while (< n cnt) (setq radcc2 (+ c2rad mtcrad)) (setq radcc3 (+ c3rad mtcrad)) (setvar "cecolor" "green") (cinaic c2ctr radcc2 c3ctr radcc3) (setq mtcrad (* 1.02 mtcrad)) (setq n (+ n 1)) ) (command "_.LINE" haptlst_a "") (command "_.LINE" haptlst_b "") (setq haptlst_a ()) (setq haptlst_b ()) (setq ctoc (distance c3ctr c1ctr)) (setq mtcrad (/ (- ctoc (+ c3rad c1rad)) 2)) (if (< mtcrad (* (getvar "VIEWSIZE") 0.005)) (setq mtcrad (* (getvar "VIEWSIZE") 0.02)) ) (setq cnt (* (/ 1 mtcrad)500)) (if (< cnt 50) (setq cnt 50) ) (if (> cnt 350) (setq cnt 350) ) (setq n 1) ;; CYAN ARC ;(setq cnt 200) ; set special count, usually for arc extension (while (< n cnt) (setq radcc3 (+ c3rad mtcrad)) (setq radcc1 (+ c1rad mtcrad)) (setvar "cecolor" "cyan") (cinaic c3ctr radcc3 c1ctr radcc1) (setq mtcrad (* 1.02 mtcrad)) (setq n (+ n 1)) ) (command "_.LINE" haptlst_a "") (command "_.LINE" haptlst_b "") (setvar "cecolor" syscolor) (setvar "pdsize" syssize) (setvar "pdmode" syspdmode) (setvar "CLAYER" syslayer) (setvar "CMDECHO" 1) (setq cset nil) (princ) ) ;DAIC.LSP Program to delete entities generated by AIC ; on the AIC layer. ; 7-31-09 Working version by CALCAD (defun c:daic (/ vcset n ssln vc_en) (setq vcset (ssget "X" '((8 . "AIC")))) ; select all entities on AIC layer (if (/= vcset nil) (progn (setq n 0) (setq ssln 0) (setq ssln (sslength vcset)) (repeat ssln (setq vc_en (ssname vcset n)) (entdel vc_en) (setq n (+ n 1)) ) ) ) (setq vcset nil) (princ) ) Quote
CAB Posted August 1, 2009 Posted August 1, 2009 Jim, All you need is the column circumference & the center can be calculated. ;; CAB 07.29.09 ;; Note that fuzz allows for inexact measurements ;; If column centers are not within the fuzz measurment then all ;; three test will produce a column & an Alert. (defun c:GetColumn (/ p1 p2 p3 r1 r2 r3 fuzz ang cr d1 d2 d3 ope pc1 pc2 pc3 rad s1 s2 s3) (setq fuzz 0.01 clay "0" ) (defun MakeCircle (cpt rad lay) (entmakex (list (cons 0 "CIRCLE") (cons 6 "BYLAYER") (cons 8 lay) (cons 10 cpt) (cons 39 0.0) (cons 40 rad) ; radius (cons 62 256) (cons 210 (list 0.0 0.0 1.0)) ) ) ) ;;D. C. Broad, Jr. ;;(sideof <ray-origin> <another-point-on-ray> <point-to-be-tested>) (defun SideOf (p1 p2 p / r) (setq r (cond ((equal p1 p 1e-10) 0) (t (sin (- (angle p1 p) (angle p1 p2)))) ) ) (if (equal r 0 1e-10) 0 r ) ) ;;return values ;;negative = point is to the right side of the ray ;;0 = point is on the ray ;;otherwise point is on the left side of the ray. ;;P1 should not equal P2 for meaningful results. ;; return 2 points in a list (defun acos (z) (atan (sqrt (- 1.0 (* z z))) z)) ;; Start here <------------<<< (if (and (setq p1 (getpoint "\nPick First origin of measurement...")) (setq d1 (getdist "\nEnter distance to column.")) (setq p2 (getpoint "\nPick Second origin of measurement...")) (setq d2 (getdist "\nEnter distance to column.")) (setq p3 (getpoint "\nPick Third origin of measurement...")) (setq d3 (getdist "\nEnter distance to column.")) (setq cr (getdist "\nEnter column circumference.")) ) (progn (setq rad (/ cr (* 2 pi))) ;;=========================================== (setq s1 (distance p1 p2) s2 (+ d2 rad) s3 (+ d1 rad) ) (setq ang (acos (/ (- (+ (* s1 s1) (* s3 s3)) (* s2 s2)) (* 2 s1 s3)))) (if (minusp (SideOf p1 p2 p3)) (setq ope -) (setq ope +) ) (setq pc1 (polar p1 (ope (angle p1 p2) ang) s3)) ;;=========================================== (setq s1 (distance p2 p3) s2 (+ d3 rad) s3 (+ d2 rad) ) (setq ang (acos (/ (- (+ (* s1 s1) (* s3 s3)) (* s2 s2)) (* 2 s1 s3)))) (if (minusp (SideOf p2 p3 p1)) (setq ope -) (setq ope +) ) (setq pc2 (polar p2 (ope (angle p2 p3) ang) s3)) ;;=========================================== (setq s1 (distance p3 p1) s2 (+ d1 rad) s3 (+ d3 rad) ) (setq ang (acos (/ (- (+ (* s1 s1) (* s3 s3)) (* s2 s2)) (* 2 s1 s3)))) (if (minusp (SideOf p3 p1 p2)) (setq ope -) (setq ope +) ) (setq pc3 (polar p3 (ope (angle p3 p1) ang) s3)) ;;------------------------------------------------ (cond ((and (< (distance pc1 pc2) fuzz) ;; All test equal (< (distance pc2 pc3) fuzz) (< (distance pc3 pc1) fuzz) ) (MakeCircle pc1 rad clay) ; close enough ) (t (MakeCircle pc1 rad clay) (MakeCircle pc2 rad clay) (MakeCircle pc3 rad clay) (alert "Column center not exact so three columns created.") ) ) ) ) (princ) ) Quote
CALCAD Posted September 10, 2009 Posted September 10, 2009 Jimforbz, I happened to come across a reference to tangent circles that led me to re-write the TTT program that you found. Is this what you had in mind? ;================================================================== ; T3 ; ; From the questionable subgenius of CALCAD : ; ; Routine that: ; ; Allows the user to draw a circle that is tangent to three ; points - just a slight improvement to the built-in CIRCLE ; command with the 3P option and tangent snap on. ;================================================================== (defun c:t3 (/ *ERROR*) (defun *ERROR* (msg) (setvar "osmode" oldsnap) (princ) ) (setq oldsnap (getvar "osmode")) (setvar "osmode" 256) (command "._CIRCLE" "3p" pause pause pause) (setvar "osmode" oldsnap) (princ) ) Quote
ronjonp Posted September 10, 2009 Posted September 10, 2009 Nice.... boy was I over thinking this one Quote
CALCAD Posted September 20, 2009 Posted September 20, 2009 Thanks ronjonp. I was at first surprised that Autocad apparently did not have the three-tangent capability. Jimforbz himself says in post #6 that he knows Autocad DOES have this capability. I wondered how he knew that because I couldn't figure it out. I looked at several other CAD programs : Cadkey, Solidworks and Intellicad, and they all are three-tangent capable. It just seemed unreasonable that Autocad couldn't do it. Then, more or less accidentally, I came across a quote from some book about Autocad that you need the combination of the 3P option and the tangent snap to get a circle tangent to three other objects. It may seem obvious once it's pointed out, but it was not obvious to me. As far as I know, the Autocad help file doesn't mention this. It's true that we were all "overthinking" the problem, but that's what many curious people have been doing for thousands of years. And if it wasn't for their efforts that provided the foundation, the Autocad system developers could never have provided the "simple" solution to the problem. I hope Jimforbz comes back to the forum and finds the T3 program. I think it's just what he asked for. Quote
Yuewei Ma Posted October 23, 2012 Posted October 23, 2012 Hi Jimforbz, I have downloaded the file named "ttt.zip". I think it is too simple. Can you give me some opinions about how to draw an circle tangent to other three circles by AutoLISP automatically, rather than utlising the mouse to search the tangent point on the AutoCAD drawing window? Many thanks to you. Hi CAB Thanks for your response and applogies for my delay (I was away last week). I have treid to experiment with the mathematics but my knowledge is stumbling over re-arrangeing the complex quadratics you get when trying to manipulate cartesain coordinates. I know there must be a way of solving this as AuotCAD already contains this cabability. However, the how is beyond me. I realise now that getpoint only stores a point not the tangent data connected to a point around an arc or circle. Anyway, many thanks for your input and the links (they were very helpful - I also found 'ttt.zip' before I blogged here which tries to use the same principle) but I think I'll have to go away and give this some more detailed thought/maths and perhaps googe it up some more. Quote
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.