;;--------------------------------------------------------------------- ;; Function: C:JOINER (c)1997 AUTO-CODE MECHANICAL/KCI ;; October 1997 W.Kramer ;; ;; FREEWARE! Use this code in any manner you want, as an example, ;; for production, or anything. But use it at your own ;; risk! IT DOES MODIFY the drawing. ;; ;; This example function can be used to join LINE and ARC objects into ;; POLYLINE/LWPOLYLINE objects. It is provided as a potential solution ;; to the problem of creating polyline objects in preparation for running ;; AUTO-CODE. ;; ;; Note that not all drawings are suitable for this operation. It was ;; intended as a tool for use in programming wire EDM, laser, flame, ;; and contour mill parts. ;; ;;--------------------------------------------------------------------- (defun C:JOINER ( / SS1 EN TRAP DOIT) (setvar "CMDECHO" 0) (prompt "\nConverts LINE and ARC objects to Polylines.") (command "_ZOOM" "_E") (setq DOIT 'T CNT 0) (while (and DOIT (setq SS1 (ssget "X" '((-4 . "") (67 . 0) ) )) ) (setq EN (ssname SS1 0) CNT (1+ CNT) ) (if (null TRAP) (setq TRAP EN) (if (eq TRAP EN) (setq DOIT nil)) ) (command "_PEDIT" EN "_Yes" "_Join" SS1 "" "") ) (prompt (strcat "\n" (itoa CNT) " entities converted.")) (if DOIT (prompt "\nJOINER finishes normally.") (prompt "\nJOINER may not have gotten them all.") ) (princ) )