(defun C:RCP (/ PL_select PL_Name PL_DataSet Testliste new_Ctrl_Pointlist first_Part last_part L_ok i Listenelement Ctrl_Pointlist Crtl_Pointnumb def_Pos k vergleich umkehrung kruemmung sicher austausch austausch1 austausch3 kruemmung_alt zähler anzahl) (while (not (setq PL_select (entsel)))) (setq PL_Name (car PL_select) PL_DataSet (entget PL_Name) Testliste (list 10 40 41 42) new_Ctrl_Pointlist (list) first_Part (list) last_part (list) L_ok nil i 0) (cond ((= (cdr (assoc 0 PL_DataSet)) "LWPOLYLINE") (while (not L_ok) (setq Listenelement (nth i PL_DataSet)) (if (/= (car Listenelement) 10) (setq first_Part (append first_Part (list Listenelement))) (setq L_ok T) ) (setq i (+ i 1)) ); while (setq L_ok nil i 0) (while (not L_ok) (setq Listenelement (nth i (reverse PL_DataSet))) (if (not (member (car Listenelement) Testliste)) (setq last_part (append last_part (list Listenelement))) (setq L_ok T last_Part (reverse last_Part)) ) (setq i (+ i 1)) );while (setq Ctrl_Pointlist (reverse (cdr (reverse (member (assoc 10 PL_DataSet) PL_Dataset))))) (setq Crtl_Pointnumb (/ (length Ctrl_Pointlist) 4) i 0) (while (< i Crtl_Pointnumb) (setq k 0) (setq def_Pos (- (length Ctrl_Pointlist) (* (+ i 1) 4))) (while (< k 4) (setq vergleich (caar (list (nth (+ def_pos k) Ctrl_Pointlist)))) (if (= vergleich 42); wenn Krümmungsklammer (progn;dann (setq umkehrung (* -1 (cdar (list (nth (+ def_pos k) ctrl_pointlist))))) (setq kruemmung (cons '42 umkehrung)) (if (= umkehrung 0) (progn (if (and (= def_pos 0) sicher) (setq kruemmung sicher) ) (setq new_Ctrl_Pointlist (append new_Ctrl_Pointlist (list kruemmung))) ) (progn; sonst, wenn Krümmung ungleich 0 (setq anzahl (length new_ctrl_pointlist)) (if (< anzahl 4) (progn;dann (if (or (= (cdr (assoc 70 PL_DataSet)) 1) (= (cdr (assoc 70 PL_DataSet)) 129)) (setq sicher kruemmung) ) (setq kruemmung (cons '42 '0.0)) (setq new_ctrl_pointlist (append new_Ctrl_Pointlist (list kruemmung))) );progn (progn;sonst (setq austausch (reverse new_ctrl_pointlist)) (setq kruemmung_alt (assoc 42 austausch)) (setq zähler 0) (setq austausch1 (list)) (repeat 3 (setq austausch1 (append austausch1 (list (nth zähler austausch)))) (setq zähler (1+ zähler)) );repeat (setq austausch (cdr austausch)) (setq austausch3 (member (assoc 41 austausch) austausch)) (setq austausch (cons kruemmung austausch3)) (setq austausch (append austausch1 austausch)) (setq new_Ctrl_Pointlist (reverse austausch)) (setq new_Ctrl_Pointlist (append new_Ctrl_Pointlist (list kruemmung_alt))) );progn );if );progn );if );progn (setq new_Ctrl_Pointlist (append new_Ctrl_Pointlist (list (nth (+ def_Pos k) Ctrl_Pointlist)))); wenn nicht Krümmungsklammer );if (setq k (+ k 1)) );while (setq i (+ i 1)) );while (setq new_PL_DataSet (append first_Part new_Ctrl_Pointlist last_Part)) (if (not (entmod new_PL_DataSet)) (prompt "\n...konnte LWPolylinie nicht modifizieren!"))) (t nil)) (princ))