Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Edit single attribute value

10 REPLIES 10
SOLVED
Reply
Message 1 of 11
vahe.holtian
633 Views, 10 Replies

Edit single attribute value

hi

 

I want to edit 1 attribute value in a block to number all my blocks (eg A001, A002, A003...) (example picture attached)

 

I know about the attout and attin but I need a lsp routine that only changes one attribute value without having to double click and go through that.

 

i attached a lsp routine, id be really thankful if someone could edit it for me and remove everything except the value part.

 

thanks

10 REPLIES 10
Message 2 of 11
3wood
in reply to: vahe.holtian

You can try attached routine ALTEXT.

Message 3 of 11
vahe.holtian
in reply to: vahe.holtian

its isnt very convenient to me because it opens another box.

 

i wanted something like the lisp i attached (1- click on the attribute that i want to change, 2- enter new attribute value, 3- click enter to choose another attribute to change)

Message 4 of 11
hmsilva
in reply to: vahe.holtian

vahe.holtian,

each block has only one attribute or has more than one?

 

Attaches one of your blocks to change.

 

Henrique

EESignature

Message 5 of 11
hmsilva
in reply to: vahe.holtian

vahe.holtian,

just pick the text to edit,

and type the new text.

Minimally tested

(defun c:NTag (/ ent obj new)
  (vl-load-com)
  (setq ent (car (nentsel "\nSelect Att Tag to Edit:")))
  (setq obj (vlax-ename->vla-object ent))
  (setq new (getstring "\nType the New Text: "))
  (vla-put-textstring obj new)
)

 Henrique

EESignature

Message 6 of 11
vahe.holtian
in reply to: hmsilva

hey henrique. this is exactly what i wanted, many thanks ! Smiley Very Happy

 

is it possible that you change it so that it doesnt exit after entering the new value? i want it to ask for another attribute to change.

 

thanks again!

Message 7 of 11
hmsilva
in reply to: vahe.holtian

vahe.holtian,
You're welcome.

 

(defun c:NTag (/ ent obj new)
  (vl-load-com)
  (if (setq ent (car (nentsel "\nSelect Att Tag to Edit:")))
    (progn (setq obj (vlax-ename->vla-object ent))
	   (setq new (getstring "\nType the New Text: "))
	   (vla-put-textstring obj new)
	   (C:NTag)
    );progn
    (princ)
  );if
)

 

Henrique

EESignature

Message 8 of 11
vahe.holtian
in reply to: hmsilva

hey, it only asks twice. i wanted it to keep asking for another attribute until i exit

Message 9 of 11
hmsilva
in reply to: vahe.holtian

vahe.holtian,

the code keeps asking until you press enter or not select anything...

 

Henrique

EESignature

Message 10 of 11
vahe.holtian
in reply to: hmsilva

ok thanks its working

Message 11 of 11
hmsilva
in reply to: vahe.holtian

You're welcome, vahe.holtian.

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost