Danke, die hatte ich zwar schon entdeckt - dennoch sind da nicht alle Funktionen drin
Ich möchte eine Sache checken, und zwar habe ich mir aus der tcircle funktion Teile entnommen, die es mir ermöglichen zu einem gew. Text eine Textfahne zu zeichen.
Code:
(defun c:xxx ( / *error* na e1 a lobj)
(defun *error* (msg)
(princ msg)
)
(acet-error-init
(list (list "cmdecho" 0
"highlight"
(getvar "highlight")
"limcheck" 0
);list
T
);list
);acet-error-init
(setq flt '((-4 . "<OR") (0 . "TEXT") (0 . "ATTDEF") (0 . "MTEXT") (-4 . "OR>")));setq
(princ "\nSelect TEXT, MTEXT or ATTDEF objects...")
(if (and (setq ss (ssget flt))
(setq ss (car (acet-ss-filter (list ss
'(("LAYERUNLOCKED") ;Dis-allow locked layers, non-current-space
("CURRENTUCS") ;and dis-allow objects not in current ucs
)
T
);list
);acet-ss-filter
);car
);setq
)
(if (setq pt (getpoint "\nInsert " (setq lpt (getpoint "\nLinienPunkt "))))
(progn
(drawLine ss)
)
)
)
)(defun drawLine ( ss / )
(if (setq j 0 n 0);setq
(progn
(princ (strcat "\nCreating ..."))
(repeat (sslength ss)
(setq na (ssname ss n)
e1 (entget na)
a (acet-geom-textbox e1 0.2) ; 0.2 offset Textumrandung
;;; b (acet-geom-midpoint (car a) (caddr a))
);setq
(setq lobj
(entmakex
(list '(0 . "LWPOLYLINE")
'(100 . "AcDbEntity")
'(100 . "AcDbPolyline")
'(90 . 4)
(cons 38 (last (cdr (assoc 10 e1))))
'(70 . 1)
(cons 10 (trans (nth 0 a) 1 (cdr (assoc 210 e1)))) ; Rechteck vom 1ter punkt
;;; (if (equal ent "Rectangles")
;;; '(42 . 0.0)
;;; '(42 . -1.0)
;;; );if
; wie wird hier eine Transformation ermittel, ich sehe nur in (nth 0 a) steht Punkt in (assoc 210 e1)??? Direction auf was
(cons 10 (trans (nth 1 a) 1 (cdr (assoc 210 e1)))) ; 2ter punkt
'(42 . 0.0)
;;; (cons 10 (trans (nth 2 a) 1 (cdr (assoc 210 e1)))) ; 3ter punkt
;;; (if (equal ent "Rectangles")
;;; '(42 . 0.0)
;;; '(42 . -1.0)
;;; );if
;;; (cons 10 (trans (nth 1 a) 1 (cdr (assoc 210 e1)))) ; 4ter punkt
;;; '(42 . 0.0)
(assoc 210 e1)
)
);entmake
)
(setq j (+ j 1));setq
(setq n (+ n 1));setq
);repeat
;nicht sehr elegant, aber ich möchte den Text (na entity) verschieben und den Unterstrich lobj
; hier sollte aber noch der Abstand 0.2 von der Linie berücksichtigt werden
; muss ich da wiederum eine Transformation berechnen ?
(command "_move" na "" (cdr (assoc 10 e1)) pt)
(command "_move" lobj "" (cdr (assoc 10 (entget lobj))) pt)
(command "_line" lpt pt "")
)
(princ "Done.")
)(princ)
)
------------------
Gruss Dirk
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP