doking
Guest
who of you could kindly suggest, gp, a lisp that converts me a circle formed by two arches in a normal circle, is already he there is turn the corners of a polyline in radius 3, thank you :d
the joint command joins the two arches but does not make them a circle and our pantograph does a bit to dick with this kind of holesYou don't need lisp, use the joint command.
if with the unsci command does not turn them into a circle is because the two arches do not appear to the same circle. could have different radius.the joint command joins the two arches but does not make them a circle....
(defun c:atc (/ *error* lay e1 enm1 arclay c rad #count)
;;; error handler
(defun *error* (#message)
(command "_.undo" "_end")
(and
#message
(or (member
#message
'("console break" "function cancelled" "quit / exit abort")
) ;_ member
(princ (strcat "\nerror: " #message))
) ;_ or
) ;_ and
) ;_ defun
(setvar "cmdecho" 0)
(command "_undo" "_begin")
(command "_ucs" "_w")
(prompt "\narc to circle: ")
(setq lay (getvar "clayer")
e1 (ssget ":l" '((0 . "arc")))
) ;_ setq
(if e1
(repeat (setq #count (sslength e1))
(setq #count (1- #count)
enm1 (ssname e1 #count)
arclay (cdr (assoc 8 (entget enm1)))
c (cdr (assoc 10 (entget enm1)))
rad (cdr (assoc 40 (entget enm1)))
) ;_ setq
(entdel enm1)
(command "_layer" "_set" arclay "")
(command "_circle" c rad)
(command "_layer" "_set" lay "")
)
) ;_ if
(*error* nil)
(setvar "cmdecho" 1)
(princ)
) ;_ defun
thank you 1000 dieva, but I'm afraid that programming does not understand a barI attach the modified version of atc.
the original version in fact works only with autocad in English and you find it here:http://www.cadtutor.net/forum/showt...ing-converting-arc-to-circle-lisp-code-please!
below the modified version for different languages.Of course you should select only one arch.Code:(defun c:atc (/ *error* lay e1 enm1 arclay c rad #count) ;;; error handler (defun *error* (#message) (command "_.undo" "_end") (and #message (or (member #message '("console break" "function cancelled" "quit / exit abort") ) ;_ member (princ (strcat "\nerror: " #message)) ) ;_ or ) ;_ and ) ;_ defun (setvar "cmdecho" 0) (command "_undo" "_begin") (command "_ucs" "_w") (prompt "\narc to circle: ") (setq lay (getvar "clayer") e1 (ssget ":l" '((0 . "arc"))) ) ;_ setq (if e1 (repeat (setq #count (sslength e1)) (setq #count (1- #count) enm1 (ssname e1 #count) arclay (cdr (assoc 8 (entget enm1))) c (cdr (assoc 10 (entget enm1))) rad (cdr (assoc 40 (entget enm1))) ) ;_ setq (entdel enm1) (command "_layer" "_set" arclay "") (command "_circle" c rad) (command "_layer" "_set" lay "") ) ) ;_ if (*error* nil) (setvar "cmdecho" 1) (princ) ) ;_ defun
save the attached file on disk and then upload it to autocad. to load see here: http://www.cad3d.it/forum1/threads/496-come-caricare-un-lispthen type atc to start the command... would I ask too much if I asked you to be a clearer peline?
:redface: