;;; ;;; CED.LSP - "Copy & EDit" Texte & Böcke mit Attributen ;;; ;;; (defun c:ced () ;;( / obj ol bp w) (command "_.UNDO" "_GROUP") (prompt "\n\t*** Block-/Textobjekt kopieren/schieben, drehen & editieren *** v1.1") (if (not mod) (setq mod "Kopieren")) (prompt (strcat "\nObjekt waehlen (" mod ") [Modus/Drehen.../]: ")) (while (not (setq obj (progn (initget "Modus Drehen Exit ,") (entsel "")))) ) (cond ((member obj '("" "Exit")) (setq obj (entlast))) ((= obj "Modus") (progn (prompt (strcat "\n>>Objektmodus (" mod ") [Kopieren/Schieben]: ")) (initget "Kopieren Schieben") (setq mod (getkword)) (if (= mod nil) (setq mod "Kopieren")) (while (not (setq obj (progn (initget "Exit ,") (entsel ">>Objekt waehlen/: ")))) ) (cond ((member obj '("" "Exit")) (setq obj (entlast))) (T (progn (setq obj (car obj)) (redraw obj 3))) ) ) ) ((= obj "Drehen") (progn (if (not $dx) (setq $dx "Nie")) (prompt (strcat "\n>>Objekt drehen (" $dx ") [Immer/Wahl/]: ")) (initget "Immer Wahl Nie") (setq $dx (getkword)) (if (= $dx nil) (setq $dx "Nie")) (while (not (setq obj (progn (initget "Exit ,") (entsel ">>Objekt waehlen/: ")))) ) (cond ((member obj '("" "Exit")) (setq obj (entlast))) (T (progn (setq obj (car obj)) (redraw obj 3))) ) ) ) (T (progn (setq obj (car obj)) (redraw obj 3))) ) ;; Objekt Kopieren/Schieben (setq ol (entget obj)) ;; (if (and (= (cdr (assoc 72 ol)) 0) (= (cdr (assoc 73 ol)) 0) ) ;;; (assoc 11 ol) (if (or (and (= (cdr (assoc 72 ol)) 0) (= (cdr (assoc 73 ol)) 0) ) ;;; (assoc 11 ol) (= (cdr (assoc 72 ol)) nil) (= (cdr (assoc 73 ol)) nil) ) (setq bp (cdr (assoc 10 ol))) (setq bp (cdr (assoc 11 ol))) ) (cond ((= mod "Kopieren") (command "._copy" "_single" obj bp pause)) ((= mod "Schieben") (command "._move" "_single" obj bp pause)) ) (redraw obj 4) ;; Objekt Drehen?! (redraw (entlast) 3) (cond ((= $dx "Immer") (cedr)) ((= $dx "Wahl") (progn (prompt "\n>>Objekt drehen (J/)? ") (initget "Ja Nein") (setq w (getkword)) (if (= w nil) (setq w "Nein")) (if (= w "Ja") (cedr)) ) ) ) ;; Objekt Editieren (if (= mod "Kopieren") (setq ol (entget (entlast)) obj (entlast)) (setq ol (entget obj)) ) (cond ((= "ATTRIB" (cdr (assoc 0 ol))) (command "._ddatte" obj) ) ((= "INSERT" (cdr (assoc 0 ol))) (command "._ddatte" obj) ) ((= "TEXT" (cdr (assoc 0 ol))) (command "._ddedit" obj "") ) (T (alert "Objekt war kein Block oder Text!!!") ) ) (redraw (entlast) 4) (princ) ) ;;; (defun cedr ( / nw nw1) (setq ol (entget (entlast))) (setq bp (cdr (assoc 10 ol))) (setq nw1 nil) (initget 128 "Bezug") (setq nw (getangle bp ">>Winkel [Bezug]: ")) (if (not nw) (setq nw 0.0) (if (= nw "Bezug") (command "._rotate" "_single" (entlast) bp "_reference" pause pause) (progn (setq nw (* (/ 180 PI) nw)) (command "._rotate" "_single" (entlast) bp nw) ;; (command "._rotate" "_single" (entlast) bp pause) ) ) ) (command "_.UNDO" "_END") (princ) ) ;;; ;;;(defun c:~ () (command)(~)(princ)) (princ "\n\tTippen Sie \"CED\" bei Befehl:\n") (princ)