; m2ha.lsp ; ; (defun c:m2ha() ; ; (princ "m2ha - m2 zu ha") (print ) (initget 1) (setq anz_nachkomma (getint "Anzahl der Nachkommastellen: ")) (setq ha_lay (getstring "Layer für ha-Werte")) (command "layer" "ma" ha_lay "") (princ "texte Auswählen") (setq tl (ssget)) (setq anz (sslength tl)) (setq x 0) (while (< x anz) (setq ct (ssname tl x)) (setq ctl (entget ct)) (setq altwert_txt (cdr (assoc 1 ctl))) (setq altwert (atof altwert_txt)) (setq neuwert (/ altwert 10000)) (setq neuwert_txt (strcat (rtos neuwert 2 anz_nachkomma) " ha")) (setq ytext (caddr (assoc 10 ctl))) (setq xtext (cadr (assoc 10 ctl))) (setq text_hoehe (cdr (assoc 40 ctl))) (setq p1 (cons 0 "TEXT")) (setq p2 (cons 100 "AcDbEntity")) (setq p3 (cons 100 "AcDbText")) (setq p4 (cons 8 ha_lay)) (setq p5 (list 10 xtext ytext)) (setq p6 (cons 40 text_hoehe)) (setq p7 (cons 1 neuwert_txt)) (setq ee nil) (setq ee (list p1 p2 p3 p4 p5 p6 p7)) (setq neu_text (entmake ee)) ; ; ; setzen spezieller Attribute s. ACAD-Handbuch, Anhang C (S 563ff) ; ; textinhalt setzen auf neuwert_txt (setq x (1+ x)) ) )