aridzv Posted February 24, 2021 Posted February 24, 2021 (edited) Hi. I have a block representing a pipe. all the attributes are invisible. the block is already in the drawing - no need to insert it. I have a lisp that enable me to use the DIST command to set the value of the pipe length and set it to the "QUANTITY" attribute value. the problem with this lisp is that the attribute must be visible. is it possible to select the block and make the lisp to enter the value to the "QUANTITY" attribute value? here is the lisp: (defun c:NLENGTH ( / obj p1 di ) (setq p1 (getpoint "\nPoint 1: ")) (setq di (getdist p1 "\nDistance: ")) (setq obj (vlax-ename->vla-object (car (nentsel "\nPick attribute ")))) (vla-put-textstring obj di) (command "regen") (princ) ) basically what i need is this: 1.prompt to set the distance (exist in the lisp). 2. prompt to select the block (now it is prompt me to select the attribute it self). 3. insert the distance value in to the value field of the "QUANTITY" attribute. many thanks, Ari. Edited February 24, 2021 by aridzv Quote
pBe Posted February 24, 2021 Posted February 24, 2021 if the TAG name is known you can use setpropertyvalue (defun c:NLENGTH (/ obj p1 di) (setq p1 (getpoint "\nPoint 1: ")) (setq di (getdist p1 "\nDistance: ")) (setq obj (car (entsel "\nSelect Block "))) (setpropertyvalue obj "QUANTITY" (rtos di)) (command "regen") (princ) ) 1 Quote
aridzv Posted February 24, 2021 Author Posted February 24, 2021 @pBe THANKS!!! works perfectly!!! Ari. 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.