[sorry for the double post but I wasn't able to edit the previus one]
hi, sorry fo the late reply but I wasnt on my office so I wasnt able to test the code before and answer.
I've tested the code but it don't do anything. I added the code to the one that I got until now but still without doing anyting.
this is the code that I got and work
defun C:miprog()
(command "._layer" "_M" "clave_catastral" "")
(setq TargEnt (car (entsel "\nSelect object on layer to select: ")))
(setq TargLayer (assoc 8 (entget TargEnt)))
(sssetfirst nil (ssget "_X" (list TargLayer)))
(setq curlay (getvar "clayer"))
(setq ss1 (ssget))
(command "copy" ss1 "" "0,0" "0,0")
(command "chprop" "p" "" "layer" curlay "lt" "bylayer" "s" "1.0"
(princ)
); defun
unti now this creates a new layer, askes me to choose an objet that I want to copy and and makes a copy from all the objets in a the layer from the objet that I choosed to the new one
now, I was working with this code (Is not mine I took it from somewhere)
(defun C:miprog()
(command "._layer" "_M" "clave_catastral" "")
(setq TargEnt (car (entsel "\nSelect object on layer to select: ")))
(setq TargLayer (assoc 8 (entget TargEnt)))
(sssetfirst nil (ssget "_X" (list TargLayer)))
(setq curlay (getvar "clayer"))
(setq ss1 (ssget))
(command "copy" ss1 "" "0,0" "0,0")
(command "chprop" "p" "" "layer" curlay "lt" "bylayer" "s" "1.0"
"")(princ)
(setq olderr *error*
*error* chgterr
chm 0)
(setq p (ssget))
(if p (progn
(while (= 0 (setq osl (strlen (setq os (getstring t "\nOld string: ")))))
(princ "Null input invalid")
)
(setq nsl (strlen (setq ns (getstring t "\nNew string: "))))
(setq l 0 n (sslength p))
(while (< l n)
(if (= "TEXT"
(cdr (assoc 0 (setq e (entget (ssname p l))))))
(progn
(setq chf nil si 1)
(setq s (cdr (setq as (assoc 1 e))))
(while (= osl (setq sl (strlen
(setq st (substr s si osl)))))
(if (= st os)
(progn
(setq s (strcat (substr s 1 (1- si)) ns
(substr s (+ si osl))))
(setq chf t)
(setq si (+ si nsl))
)
(setq si (1+ si))
)
)
(if chf (progn
(setq e (subst (cons 1 s) as e))
(entmod e)
(setq chm (1+ chm))
))
)
)
(setq l (1+ l))
)
))
(princ "Changed ")
(princ)
)
this one sent me a dialog box that asks me for ol styring and new string, but I dont want replace anything, I need add 6 zero after the numbers and a dialog box that allows me to add 8 numbers before the code
as I said Im not good in programing, I just can read the code but Im not able to wirte it or know exactli what it does