Jump to content

Recommended Posts

Posted

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"
)

  • Replies 47
  • Created
  • Last Reply

Top Posters In This Topic

  • CadFrank

    23

  • Tharwat

    12

  • BlackBox

    5

  • hanhphuc

    4

Posted
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 :D Works like a charme.

 

Thanks again !

 

I think my problem is I don't know when to localise my Variable and Arguments :(

Posted
Once again! Your help is really appreciated :D 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

Posted

(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 !

Posted

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

Posted

Well I figure it out using mapcar. :) so now it works

 

But thanks for the information well appreciated

Posted
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

 

Hi han.

Your signature is very interesting. can you see your message ?

Posted
Hi han.

Your signature is very interesting. can you see your message ?

replied#27

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...