Hallo Leute,
will alte Zeichnungen komplett in neue AM_.. Layer umkonvertieren.
Klapp soweit ganz gut mit den Befehlen:
(if (setq temp (ssget "X" '((0 . "DIMENSION")))) (command "eigändr" temp "" "Layer" "AM_5" ""))
(if (setq temp (ssget "X" '((0 . "MTEXT")))) (command "eigändr" temp "" "Layer" "AM_6" "Farbe" "VonLayer" "LTyp" "ByLayer" ""))
(if (setq temp (ssget "X" '((0 . "TEXT")))) (command "eigändr" temp "" "Layer" "AM_6" "Farbe" "VonLayer" "LTyp" "ByLayer" ""))
(if (setq temp (ssget "X" '((8 . "MITTE")))) (command "eigändr" temp "" "Layer" "AM_7" "Farbe" "VonLayer" "LTyp" "ByLayer" ""))
usw.
Bei Blöcken sind meine LISP-Kenntnisse aber auf ihre die Grenzen gestoßen.
Hab damit versucht:
1) Hiermit bekomme ich wunderbar die Auflistung aller Blöcke (auch die *D.. und *U.., was auch immer das sein soll, vielleicht dynamisch Blöcke???)
(while (setq BL(tblnext "BLOCK" T)) ----> geht durch die Blocktabelle
(command "_-bedit" (princ(strcat "\n"(cdr(assoc 2 BL)))))
;hier sollen die Konvertierungsbefehle (wie oben) kommen
(command "_bclose" "")
)
2) Damit kann ich wunderbar einzelnen Block konvertieren
(command "_-bedit" "Seitenansicht B95")
(if (setq temp (ssget "X" '((0 . "DIMENSION")))) (command "eigändr" temp "" "Layer" "AM_5" ""))
(if (setq temp (ssget "X" '((0 . "MTEXT")))) (command "eigändr" temp "" "Layer" "AM_6" "Farbe" "VonLayer" "LTyp" "ByLayer" ""))
(if (setq temp (ssget "X" '((0 . "TEXT")))) (command "eigändr" temp "" "Layer" "AM_6" "Farbe" "VonLayer" "LTyp" "ByLayer" ""))
(if (setq temp (ssget "X" '((8 . "MITTE")))) (command "eigändr" temp "" "Layer" "AM_7" "Farbe" "VonLayer" "LTyp" "ByLayer" ""))
usw.
(command "_bclose" "")
3) Und damit habe ich versucht alle Blöcke in der Schleife zu konvertieren
(while (setq BL(tblnext "BLOCK" T)) ----> geht durch die Blocktabelle
(command "_-bedit" (princ(strcat "\n"(cdr(assoc 2 BL)))))
(if (setq temp (ssget "X" '((0 . "DIMENSION")))) (command "eigändr" temp "" "Layer" "AM_5" ""))
(if (setq temp (ssget "X" '((0 . "MTEXT")))) (command "eigändr" temp "" "Layer" "AM_6" "Farbe" "VonLayer" "LTyp" "ByLayer" ""))
(if (setq temp (ssget "X" '((0 . "TEXT")))) (command "eigändr" temp "" "Layer" "AM_6" "Farbe" "VonLayer" "LTyp" "ByLayer" ""))
(if (setq temp (ssget "X" '((8 . "MITTE")))) (command "eigändr" temp "" "Layer" "AM_7" "Farbe" "VonLayer" "LTyp" "ByLayer" ""))
usw.
(command "_bclose" "")
)
Hier bricht er direkt ab, weil er bei Blocknamen auf Sonderzeichen stößt (*D..), oder ACAD bleibt hängen
..............
Hat da jemand ne Idee, jemand schon was ähnliches gemacht???
Vielleicht muss ich die Blöcke mit Sonderzeichen überspringen?
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP