<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Write two attibute values into a text object in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/write-two-attibute-values-into-a-text-object/m-p/6709014#M126231</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By going on the lisp given by&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ﻿&lt;/a&gt;&lt;/P&gt;
&lt;PRE&gt;(defun c:T-T ( / en tx html 3str)
  (defun 3str(txt)
    (while (&amp;lt; (strlen txt) 3)
      (setq txt (strcat "0" txt))
    )
    txt
  )

  (and	(setq en (car (nentsel "\nSelect the first text: ")))
	(setq en (vlax-ename-&amp;gt;vla-object en))
	(vlax-property-available-p en 'textstring)
	(setq tx (3str (vla-get-textstring en)))
	(setq en (car (nentsel "\nSelect the second text: ")))
	(setq en (vlax-ename-&amp;gt;vla-object en))
	(vlax-property-available-p en 'textstring)
	(setq tx (strcat tx "-" (3str (vla-get-textstring en))))
    (cond
      ((setq pt (getpoint "\nInsertion point &amp;lt;to clipboard&amp;gt;: "))
	(command "_.TEXT" "_none" pt 20 0 tx "")
      )
      (T
	(vlax-invoke (vlax-get (vlax-get (setq html (vlax-create-object "htmlfile")) 'ParentWindow) 'ClipBoardData) 'setData "Text" tx)
	(vlax-release-object html)
      )
    )
  )
  (princ)
)&lt;/PRE&gt;
&lt;P&gt;@+&lt;/P&gt;</description>
    <pubDate>Fri, 25 Nov 2016 08:43:23 GMT</pubDate>
    <dc:creator>patrick_35</dc:creator>
    <dc:date>2016-11-25T08:43:23Z</dc:date>
    <item>
      <title>Write two attibute values into a text object</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/write-two-attibute-values-into-a-text-object/m-p/6704571#M126228</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am a beginner with lisp and this is way beyond my understanding.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In our drawings we have four blocks which have different names, but all have the same attribute tag of BAL_NO. The values are all numbers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If we could to pick any two blocks and pass the two attribute values to text that can be inserted into the drawing it would save quite a bit of time as we have up to 300 of these to enter in some drawings. So the two values would be formatted as nnn-nnn, text height of 200.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been searching as I am sure this has been done before, and I can see that it may not be that difficult, but I don't really have the time at the moment to spend on the problem.&amp;nbsp; As you probably all are, we are flat out at the moment trying to get drawings out before the Christmas break.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;~Dave~&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 08:37:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/write-two-attibute-values-into-a-text-object/m-p/6704571#M126228</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-23T08:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Write two attibute values into a text object</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/write-two-attibute-values-into-a-text-object/m-p/6704938#M126229</link>
      <description>&lt;P&gt;Try the code.&lt;/P&gt;
&lt;P&gt;- select the first text (or att),&lt;/P&gt;
&lt;P&gt;- the second...&lt;/P&gt;
&lt;P&gt;- point for the new text (0 rotation, or change zero to PAUSE for user input)&lt;/P&gt;
&lt;P&gt;- or &amp;lt;enter&amp;gt; for put the combined text into clipboard.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;(defun c:T-T ( / en tx html)
  (if (and (setq en (car (nentsel "\nSelect the first text: ")))
           (wcmatch (cdr (assoc 0 (entget en))) "MTEXT,TEXT,ATTDEF,ATTRIB")
           (setq tx (cdr (assoc 1 (entget en))))
           (setq en (car (nentsel "\nSelect the second text: ")))
           (wcmatch (cdr (assoc 0 (entget en))) "MTEXT,TEXT,ATTDEF,ATTRIB")
           (setq tx (strcat tx "-" (cdr (assoc 1 (entget en)))))
           )
    (cond ((setq pt (getpoint "\nInsertion point &amp;lt;to clipboard&amp;gt;: "))
           (command "_.TEXT" "_none" pt 20 0 tx ""))
          (T
           (vlax-invoke (vlax-get (vlax-get (setq html (vlax-create-object "htmlfile")) 'ParentWindow) 'ClipBoardData) 'setData "Text" tx)
           (vlax-release-object html))))
  (princ)
)&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;</description>
      <pubDate>Wed, 23 Nov 2016 12:00:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/write-two-attibute-values-into-a-text-object/m-p/6704938#M126229</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2016-11-23T12:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: Write two attibute values into a text object</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/write-two-attibute-values-into-a-text-object/m-p/6708900#M126230</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That works for me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Just one thing&lt;/FONT&gt;... Could it change the numbers to three digits?&amp;nbsp; So at the moment they start from 1 (sometimes they are 01) and go up to 300+. We need to make the new&amp;nbsp; string to be for example 001-002, or 034-044&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have mucked around with your code but I can't get it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;cheers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;~Dave~&lt;/P&gt;</description>
      <pubDate>Fri, 25 Nov 2016 06:31:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/write-two-attibute-values-into-a-text-object/m-p/6708900#M126230</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-25T06:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: Write two attibute values into a text object</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/write-two-attibute-values-into-a-text-object/m-p/6709014#M126231</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By going on the lisp given by&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ﻿&lt;/a&gt;&lt;/P&gt;
&lt;PRE&gt;(defun c:T-T ( / en tx html 3str)
  (defun 3str(txt)
    (while (&amp;lt; (strlen txt) 3)
      (setq txt (strcat "0" txt))
    )
    txt
  )

  (and	(setq en (car (nentsel "\nSelect the first text: ")))
	(setq en (vlax-ename-&amp;gt;vla-object en))
	(vlax-property-available-p en 'textstring)
	(setq tx (3str (vla-get-textstring en)))
	(setq en (car (nentsel "\nSelect the second text: ")))
	(setq en (vlax-ename-&amp;gt;vla-object en))
	(vlax-property-available-p en 'textstring)
	(setq tx (strcat tx "-" (3str (vla-get-textstring en))))
    (cond
      ((setq pt (getpoint "\nInsertion point &amp;lt;to clipboard&amp;gt;: "))
	(command "_.TEXT" "_none" pt 20 0 tx "")
      )
      (T
	(vlax-invoke (vlax-get (vlax-get (setq html (vlax-create-object "htmlfile")) 'ParentWindow) 'ClipBoardData) 'setData "Text" tx)
	(vlax-release-object html)
      )
    )
  )
  (princ)
)&lt;/PRE&gt;
&lt;P&gt;@+&lt;/P&gt;</description>
      <pubDate>Fri, 25 Nov 2016 08:43:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/write-two-attibute-values-into-a-text-object/m-p/6709014#M126231</guid>
      <dc:creator>patrick_35</dc:creator>
      <dc:date>2016-11-25T08:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: Write two attibute values into a text object</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/write-two-attibute-values-into-a-text-object/m-p/6709314#M126232</link>
      <description>&lt;P&gt;That's great!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks to both of you, it will save so much time and effort.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Nov 2016 11:51:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/write-two-attibute-values-into-a-text-object/m-p/6709314#M126232</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-25T11:51:57Z</dc:date>
    </item>
  </channel>
</rss>

