Tharwat Posted August 14, 2014 Posted August 14, 2014 My sub-function had a typo mistake with the name of block list , anyway try it like this . (defun change-attribute-textstring (adoc TagRev Nomblo txt) (vlax-for lt (vla-get-layouts adoc) (vlax-for obj (vla-get-block lt) (if (and (= "AcDbBlockReference" (vla-get-objectname obj)) (member (vla-get-effectivename obj) Nomblo) (= :vlax-true (vla-get-hasattributes obj)) ) (foreach x (vlax-invoke obj 'getattributes) (if (= (strcase (vla-get-tagstring x)) TagRev) ; Capital string ; (vla-put-textstring x txt) ) ) ) ) ) ) (change-attribute-textstring (vla-get-activedocument (vlax-get-acad-object)) "PROJET" ; Capital string ; '("LU CARTOUCHE" "Cartouche Aliance" "LC CARTOUCHE CHUM" "LC CARTOUCHE CHUM 2" "LC CARTOUCHE" "LU CARTOUCHE PANNEAU" "CARTOUCHE LU" "LC CARTOUCHE 2" ) "Example" ) Quote
CadFrank Posted August 14, 2014 Author Posted August 14, 2014 My sub-function had a typo mistake with the name of block list , anyway try it like this . Once again! Your help is really appreciated Works like a charme. Thanks again ! I think my problem is I don't know when to localise my Variable and Arguments Quote
Tharwat Posted August 14, 2014 Posted August 14, 2014 Once again! Your help is really appreciated Works like a charme. Thanks again ! You are welcome . I think my problem is I don't know when to localise my Variable and Arguments Read THIS Quote
CadFrank Posted August 14, 2014 Author Posted August 14, 2014 (defun _Modification (/ obj atts x lt) (initget 1 "P T D V") (setq Mod (getkword "\n Quel élément voulez vous modifier? [Projet/Titre/Date/Verificateur] : ")) (if (= Mod "P") (progn (setq TProjet (strcase (getstring T "\n Quel est le nouveau nom du projet? ")) TTitre (strcase (getstring T "\n Inscrire le titre : ")) ) (setq TagPro "PROJET" TagTit "TITRE") (change-attribute-textstring (vla-get-activedocument (vlax-get-acad-object)) TagPro TagTit Nombloc TProjet Ttitre ) ) ) ) Ok another question ! why doesnt it work if I code it like this ! Quote
hanhphuc Posted August 15, 2014 Posted August 15, 2014 another, no code just tips if you have too many Tags >10 Just for sharing if forgotten export all tags command: ATTOUT -> C:\\test.txt , edit in EXCEL then import command: ATTIN -> C:\\test.txt Quote
CadFrank Posted August 15, 2014 Author Posted August 15, 2014 Well I figure it out using mapcar. so now it works But thanks for the information well appreciated Quote
AIberto Posted August 15, 2014 Posted August 15, 2014 another, no code just tips if you have too many Tags >10Just for sharing if forgotten export all tags command: ATTOUT -> C:\\test.txt , edit in EXCEL then import command: ATTIN -> C:\\test.txt Hi han. Your signature is very interesting. can you see your message ? Quote
hanhphuc Posted August 16, 2014 Posted August 16, 2014 Hi han.Your signature is very interesting. can you see your message ? replied#27 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.