HI
I have the code like below.
Is there a better way to Change the block attributes?
And i don´t understand all the things the command "_.attedit" asks me.
I send you the dwg with the block. I just want to select the block an Change with one user Input both letters or numbers.
Thank you.
(defun c:<Test7 ( / *error* BEingabe oATTREQ oATTDIA Attrib pnt ent lay cmd BEingabe)
(defun *error* (errmsg)
(if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break"))
(princ (strcat "\nError: " errmsg)))
(setvar 'CLAYER lay)
(setvar 'CMDECHO cmd)
(setvar 'ATTREQ oATTREQ)
(setvar 'ATTDIA oATTDIA)
(princ))
(setq lay (getvar 'CLAYER)
cmd (getvar 'CMDECHO))
(command "_.-LAYER" "_m" "-I-Schnittbezeichnung" "_co" "6" "-I-Schnittbezeichnung" "")
(setq oATTREQ (getvar 'ATTREQ)
oATTDIA (getvar 'ATTDIA))
(setvar 'ATTREQ 1)
(setvar 'ATTDIA 0)
(setq Attrib 1)
(if (and (setq pnt (getpoint "\nEinfügepunkt oder Schnittbezeichnung wählen: "))
(setq ent (nentselp pnt))
)
(cond ((= (length ent) 4)
(setq ent (car (cadddr ent)))
(sssetfirst nil (ssadd ent)))
((= (length ent) 2)
(setq ent (car ent))
(sssetfirst nil (ssadd ent))))
(progn
(princ "\nKein Objekt gewählt! ")
(setq Attrib 2)
(command "_.-insert" "spi-schnitt" pnt "1" "1" ""
(setq BEingabe (strcase (getstring "\nSchnittbezeichnung angeben: ")))
BEingabe)))
(if (= Attrib 1)(command "_.attedit" ?????????))
(setvar 'CLAYER lay)
(setvar 'ATTREQ oATTREQ)
(setvar 'ATTDIA oATTDIA)
(prin1)
) ; end of defun