To get a better overview, I summarized all created lisps, which I tried and working for me.
Thank you all guys who you responded.
1. LDN - Laydel, Name
2. MPT - Multiple Point
3. ZO - Zoom object
4. LP - Line perpendicular
5. LTA - Line tangent
6. C3T - tan, tan, tan
1. LDN - Laydel, Name
(defun c:ldn (/ aec_sendkeys)
(defun aec_sendkeys (cmd-arg)
(vla-Sendcommand(vla-Get-ActiveDocument(vlax-Get-Acad-Object))cmd-arg)(princ)
)
(aec_SendKeys "_.Laydel _Name\n")
)
(defun C:LDN ()
(initcommandversion)
(command "_.laydel" "_n")
(prin1)
)
2. MPT - Multiple Point
(defun c:mpt(/ pnt)
(while (setq pnt (getpoint "\nSpecify a point: "))(command "_.point" pnt))
(princ)
)
3. ZO - Zoom object
(defun c:zo ()
(command "_.zoom" "_o")
) ; defun zo
(defun c:zo( / ss)
(cond
((setq ss (last(ssgetfirst)))
(command "_.zoom" "_O" ss "")
)
(T
(princ "\nSelect object(s) to zoom to > ")
(command "_.zoom" "_O" (ssget) "")
)
)
(princ)
)
4. LP - Line perpendicular
(defun c:LP ()
(command "_.line" "_per")
(prin1)
)
5. LTA - Line tangent
(defun c:LTA (/ old_osmode)
(setq old_osmode (getvar 'osmode))
(setvar 'osmode 256)
(command "_line" pause pause "")
(setvar 'osmode old_osmode)
)
6. C3T - tan, tan, tan
(defun c:C3T()
(command "_.circle" "_3p" "_tan" pause "_tan" pause "_tan" pause)
(princ)
)
(defun c:c3t (/ *error* LM:intersections a1 a2 a3 e1 e2 e3 p1 p2 p3 a b c s r cp)
(defun *error* ( msg )
(if (not (member msg '("Function cancelled" "quit / exit abort")))
(princ (strcat "\nError: " msg))
)
(setvar 'cmdecho 1)
(princ)
)
(defun LM:intersections ( ob1 ob2 mod / lst rtn )
(if (and (vlax-method-applicable-p ob1 'intersectwith)
(vlax-method-applicable-p ob2 'intersectwith)
(setq lst (vlax-invoke ob1 'intersectwith ob2 mod))
)
(repeat (/ (length lst) 3)
(setq rtn (cons (list (car lst) (cadr lst) (caddr lst)) rtn)
lst (cdddr lst)
)
)
)
(reverse rtn)
)
(setvar 'cmdecho 0)
(setq
a1 (car(entsel "\nSelect first tangent line >"))
a2 (car(entsel "\nSelect second tangent line >"))
a3 (car (entsel "\nSelect third tangent line >"))
)
(cond
((and a1 a2 a3)
(mapcar 'set '(e1 e2 e3) (mapcar 'vlax-ename->vla-object (list a1 a2 a3)))
(setq
p1 (car(LM:intersections e1 e2 acextendnone))
p2 (car(LM:intersections e2 e3 acextendnone))
p3 (car(LM:intersections e3 e1 acextendnone))
a (distance p1 p2)
b (distance p2 p3)
c (distance p3 p1)
s (* 0.5 (+ a b c))
r (sqrt (/ (* (- s a)(- s b)(- s c)) s))
)
(command "_.xline" "B" p1 p2 p3 "")
(setq a1 (entlast))
(setq e1 (vlax-ename->vla-object (entlast)))
(command "_.xline" "B" p2 p1 p3 "")
(setq a2 (entlast))
(setq e2 (vlax-ename->vla-object (entlast)))
(setq cp (car(LM:intersections e1 e2 acextendnone)))
(command "_.circle" cp r)
(command "_.erase" a1 a2 "")
)
)
(setvar 'cmdecho 1)
(princ)
)