Kubucama Posted November 6, 2020 Posted November 6, 2020 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. Code Lisp.txt Quote
pkenewell Posted November 6, 2020 Posted November 6, 2020 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)))) to (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. 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.