Jump to content

autocad attribute automatisation


tomtenberge

Recommended Posts

good day to you all

 

i been looking high and low for this, but i can't figure it out.

i have made a block, wich include text as attributes (so they can be changed).

and now i would like to add a piece of text to it, in a special font to make it a barcode, but i need to take the value of a atribute and add astrixes (*) before and behind it, do any of you know how to do it, without making a whole lisp routine? (i am no good at lisp).

 

*edit*

i am using Autocad 2010

Link to comment
Share on other sites

Search here first 1st for "add text" to front of existing text likewise at end.

2nd search for any of the attribute update programs.

3rd you have to join them together.

 

If you only want a pick one block pretty easy

 

not tested

(vl-load-com)
(setq ss1 (car (entsel "\n pick block" )))
(foreach att (vlax-invoke (vlax-ename->vla-object SS1) 'getattributes)
   (setq newstr (vla-get-textstring att ))
(princ (strcat "\n" newstr))
   (setq ans (Getstring "\n Is this correct attribute press <Cr. for no"))
   (if (= ans nil)
   (princ)
   (progn
   (setq newstrblank (strcat "*" newstr "*"))
   (vla-put-textstring att newstrblank)
   (exit)
   )
   )
)

Link to comment
Share on other sites

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...