Jump to content

block insertion point and Block attribute value

Recommended Posts

Hello everyone,

The attached code that "Replace the text by block and transfer the value to the attribute" and the code is working.

What I intend to do now and am not succeeding in doing is the following :



1) I noticed that, the block insertion point is being at the coordinate (Geometry --> Position X of variable T2B_Text). Is it possible to insert the block at the coordinate ( Text --> Text alignment X of variable T2B_Text)?  (See image 1)


2)  Is there any way to make sure that the total value of the variable "T2B_AttributeTag" is not all transferred to the block attribute?  (See image 2)


Example: T2B_AttributeTag = TO 1301-UZY-1826A

                  Value of Block attribute (T2B_Block) = 1301-UZY-1826A                                          (Accurate this way) 





Obs : The Txt file is by (DannyNL), taken from the AutoCad forum.





Image 1.jpg

Image 2.jpg

Code Lisp.txt

Link to post
Share on other sites

If all you want to do is remove the "GHF" prefix change the following line:

(PushAttValue T2B_Block (list (list T2B_AttributeTag (vla-get-TextString T2B_Text))))


(PushAttValue T2B_Block (list (list T2B_AttributeTag (substr (vla-get-TextString T2B_Text) 4))))

If you are looking for something more generic, then let me know.

Link to post
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.

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