Hallo Lispler Habe eine Bitte kann mir jemand das Lisp so ändern, das ich dem Text am Fadenkreuz schon seh, damit ich ihn besser Platzieren kann. Danke Heinz
(defun c:num (/ nr ipt ant th prefix) (setq LAY_OLD (getvar "CLAYER")) (setq prefix (getstring "\nTextprefix: ") nr (if (setq ant (getint "\nStartnummer <0>")) (1- ant) 0 ) ;_ end of if th (getreal "\nTexthöhe:") )
(princ "\nWählen sie ein Element für die Layerschaltung : ") (setq AWS (ssget)) (setq AWS (ssname AWS 0)) (setq LAY_NEW (cdr (assoc 8 (entget AWS)))) (setvar "CLAYER" LAY_NEW)
(while (setq ipt (getpoint (strcat "\nEinfügepunkt: " (itoa (setq nr (1+ nr))) ":") ) ;_ end of getpoint ) ;_ end of setq
(entmake (list '(0 . "TEXT") '(100 . "AcDbEntity") '(67 . 0) '(410 . "Model") (cons 8 lay_new) '(100 . "AcDbText") (cons 10 ipt) (cons 40 th) (cons 1 (strcat prefix (itoa nr))) '(50 . 0.0) '(41 . 1.0) '(51 . 0.0) (cons 7 (getvar"textstyle")) '(71 . 0) '(72 . 0) ;1 ist gleich mitte Text 2 ist rechts der Text (cons 11 ipt) '(210 0.0 0.0 1.0) '(100 . "AcDbText") '(73 . 0) ; 1 ist gleich mitte Text ) ;_ end of list ) ;_ end of entmake ) ;_ end of while
Hallo das sieht dan so aus funkt aber nicht danke(defun c:num (/ nr ipt ant th prefix) (setq LAY_OLD (getvar "CLAYER")) (setq prefix (getstring "\nTextprefix: ") nr (if (setq ant (getint "\nStartnummer <0>")) (1- ant) 0 ) ;_ end of if th (getreal "\nTexthöhe:") )
(princ "\nWählen sie ein Element für die Layerschaltung : ") (setq AWS (ssget)) (setq AWS (ssname AWS 0)) (setq LAY_NEW (cdr (assoc 8 (entget AWS)))) (setvar "CLAYER" LAY_NEW)
(while (setq ipt (getpoint (strcat "\nEinfügepunkt: " (itoa (setq nr (1+ nr))) ":") ) ;_ end of getpoint ) ;_ end of setq
(entmake (list '(0 . "TEXT") '(100 . "AcDbEntity") '(67 . 0) '(410 . "Model") (cons 8 lay_new) '(100 . "AcDbText") (cons 10 ipt) (cons 40 th) (cons 1 (strcat prefix (itoa nr))) '(50 . 0.0) '(41 . 1.0) '(51 . 0.0) (cons 7 (getvar"textstyle")) '(71 . 0) '(72 . 0) ;1 ist gleich mitte Text 2 ist rechts der Text (cons 11 ipt) '(210 0.0 0.0 1.0) '(100 . "AcDbText") '(73 . 0) ; 1 ist gleich mitte Text ) ;_ end of list ) ;_ end of entmake ) ;_ end of while (setvar "CLAYER" LAY_OLD) (command "schieben" "I" ""ipt pause) )
AutoCAD, Bricscad Wir machen das Mögliche unmöglich
erstellt am: 20. Apr. 2005 14:48 <-- editieren / zitieren --> Unities abgeben: Nur für Dober Heinz
'n kleines Schmankerl von meinereiner
Code: (defun c:num (/ PointByCrosshair TXTDRAW LAY_OLD prefix nr th AWS LAY_NEW ipt) (defun PointByCrosshair (color tx wi / P p0 p1 tt) (Setq p0 (getvar "extmin") p1 (getvar "extmax") ) ;_ end of Setq (if (< (length (cdr (setq P (grread 't 5 0)))) 3) (setq P (cons 3 (list (list (+ (/ (nth 0 p0) 2) (/ (nth 0 p1) 2)) (+ (/ (nth 1 p0) 2) (/ (nth 1 p1) 2)) (+ (/ (nth 2 p0) 2) (/ (nth 2 p1) 2)) ) ;_ end of list ) ;_ end of list ) ;_ end of cons ) ;_ end of setq ) ;_ end of if (setq tt (TXTDRAW (cadr P) color tx wi)) (while (= 5 (car (setq P (grread 't 5 0)))) (if tt (entdel tt) ) ;_ end of if (setq tt (TXTDRAW (cadr P) color tx wi)) ) ;_ end of while (if tt (entdel tt) ) ;_ end of if (if (= 3 (car P)) (cadr P) ) ;_ end of if ) ;_ end of defun
(defun TXTDRAW (PKT CLR TEXT win /) (entmake (list '(0 . "TEXT") (cons 8 CLR) (cons 10 PKT) (cons 40 win) (cons 1 TEXT) '(50 . 0.0) (cons 7 (getvar "textstyle")) '(71 . 0) '(72 . 0) ) ;_ end of list ) ;_ end of entmake (entlast) ) ;_ end of defun (setq LAY_OLD (getvar "CLAYER")) (setq prefix (getstring "\nTextprefix: ") nr (if (setq nr(getint "\nStartnummer <0>")) nr 0 ) ;_ end of if th (getreal "\nTexthöhe:") ) ;_ end of setq (princ "\nWählen sie ein Element für die Layerschaltung : ") (setq AWS (ssget)) (setq AWS (ssname AWS 0)) (setq LAY_NEW (cdr (assoc 8 (entget AWS)))) (setvar "CLAYER" LAY_NEW) (while (setq ipt (PointByCrosshair lay_new (strcat prefix (itoa nr)) th) ) ;_ end of setq (TXTDRAW ipt LAY_NEW (strcat prefix (itoa nr)) th) (setq nr (1+ nr)) ) ;_ end of while (setvar "CLAYER" LAY_OLD) ) ;_ end of defun
erstellt am: 20. Apr. 2005 14:51 <-- editieren / zitieren --> Unities abgeben: Nur für Dober Heinz
Zitat:Original erstellt von Dober Heinz: (command "schieben" "I" ""ipt pause)
Zitat:Original erstellt von fca_mi2: (command "schieben" "l" "" ipt pause)
Achso ? Bei mir sieht es anders aus....
erstens: Du haste ein grosses i eingefügt; Frank hat aber ein L vorgeschlagen und zweitens: hast du bei den Leerzeichen auch ein ziemliches durcheinander reingebracht...
Lisp ist eine Programmiersprache, die keine Fehler verzeiht !