Cemreyvz,
here's a lisp that will do want you want. it is not finished, i left some work for you to do.
called it 3dshape (cause that what you will get after you extrude the region)
maybe it is little complicated for you but i add a comment at each code line
a local function (draw_circle) is called to draw the circles (one at a time) and return the cp + rad as a reference values (in autolisp it is known as quoted arguments). than the tangent line is calculated (and drawn)
than a trim command is invoked to remove the unneeded arcs and a region is created.
now heres comes your part, do the extrution.
i you do not understand something? feel free to ask.
enjoy
moshe
(defun c:3dshape (/ draw_circle asine ; local functions
ename ss p0 p1 p2 p3 p4 rad0 rad1 cx ax bx ang0 ang1 ang2)
(defun draw_circle (msg base Qpt Qrad / ent) ; function take 2 quote arguments
(if base
(set Qpt (getpoint base (strcat "\n" msg " circle center point: "))) ; indirect assigment
(set Qpt (getpoint (strcat "\n" msg " circle center point: "))) ; indirect assigment
); if
(if (eval Qpt)
(progn
(if base
(progn
; if drawing was empty, make sure ename gets the first circle
(if (not ename)
(setq ename (entlast))
)
; draw this line temporary to visualize the circle centers
(command "._line" base (eval Qpt) "")
(setq ent (entlast))
)
)
(setvar "cmdecho" 1) ; temporary enable command echo
(command "._circle" (eval Qpt) pause) ; enter radius
; warning: specifying diameter here will break the lisp with an error
(set Qrad (cdr (assoc '40 (entget (entlast))))) ; get circle radius
(if base
(entdel ent) ; erase temporary line
)
(setvar "cmdecho" 0) ; disable command echo , ensures positiove value is return (not nil)
); progn
); if
); draw_circle
; return arcsine of an angle
(defun asine (x)
(atan x (sqrt (- 1 (expt x 2))))
)
; here start c:3dshape
(setvar "cmdecho" 1) ; disable command echo
(command "._undo" "_begin") ; begin group commands for 1 undo
(setq ename (entlast))
(if (and
(draw_circle "First" nil 'p0 'rad0) ; send 2 quote arguments
(draw_circle "Second" p0 'p2 'rad1) ; send 2 quote arguments
)
(progn
(setq cx (distance p0 p2)) ; distance between centers
(setq ang0 (angle p0 p2)) ; angle between centers
(setq ax (- rad1 rad0)) ; the front edge of triangle
(setq ang1 (asine (/ ax cx))) ; sine angle -> real angle
(setq ang2 (+ ang0 ang1 (/ pi 2))) ; angle to tangent point
(setq p3 (polar p0 ang2 rad0)) ; first tangent point
(setq p4 (polar p2 ang2 rad1)) ; second tangent point
(setq ss (ssadd)) ; declar selection set
(command "._line" p3 p4 "") ; draw first tangent line
(setq ss (ssadd (entlast) ss)) ; collect to selection set
(setq ang2 (- ang0 ang1 (/ pi 2))) ; angle to mirroed tangent point
(setq p3 (polar p0 ang2 rad0)) ; first tangent point
(setq p4 (polar p2 ang2 rad1)) ; second tangent point
(command "._line" p3 p4 "") ; draw second tangent line
(setq ss (ssadd (entlast) ss)) ; collect to selection set
; trim the part of circles which are not needed to create region
(command "._trim" "_si" ss (polar p0 (angle p0 p2) rad0) (polar p2 (angle p2 p0) rad1) "")
; gether remaining arcs to selection set
(setq ss (ssadd))
(while ename
(ssadd ename ss)
(setq ename (entnext ename))
); while
(command "._region" "_si" ss) ; make region
; continue here to create your extrude 3d solid
; ......
; ......
); progn
); if
(command "._undo" "_end") ; end group commands
(setvar "cmdecho" 1) ; enable command echo
(princ)
)