<?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: Paste Special in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/paste-special/m-p/5671439#M140927</link>
    <description>&lt;P&gt;Hi sbanister,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the 'Pastespec' command don't have a command line version...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps alt-edited"&gt;Perhaps&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;something like this&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;will do the trick (untested)...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:demo (/ _GetClipBoardText pt str)

  (defun _GetClipBoardText (/ htmlfile result)

    ;;  Attribution: Reformatted version of
    ;;  post by Patrick_35 at theswamp.org.
    ;;
    ;;  See http://tinyurl.com/2ngf4r.

    (setq result
           (vlax-invoke
             (vlax-get
               (vlax-get
                 (setq htmlfile (vlax-create-object "htmlfile"))
                 'ParentWindow
               )
               'ClipBoardData
             )
             'GetData
             "Text"
           )
    )
    (vlax-release-object htmlfile)
    result
  )

  (if (and (setq str (_GETCLIPBOARDTEXT))
           (setq pt (getpoint "\nSpecify text start point: "))
      )
    (entmake
      (list
        (cons 0 "TEXT")
        (cons 100 "AcDbText")
        (cons 10 pt)
        (cons 40 (getvar "TEXTSIZE"))
        (cons 1 str)
        (cons 100 "AcDbText")
      )
    )
  )
  (princ)
)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps, &lt;BR /&gt;Henrique&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jun 2015 12:08:53 GMT</pubDate>
    <dc:creator>hmsilva</dc:creator>
    <dc:date>2015-06-10T12:08:53Z</dc:date>
    <item>
      <title>Paste Special</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/paste-special/m-p/5671352#M140926</link>
      <description>&lt;P&gt;Has anyone go a lisp for bring in unformatted text from a Microsoft Office application?&lt;/P&gt;
&lt;P&gt;My current procedure is as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the office document, highlight the text to copy, click copy&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;In AutoCAD 'Pastespec'&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Press the 'T' ket (for paste as Text)&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;(The text now comes in as an MTEXT object)&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Click 'Explode' to reduce the entity to plain text&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Action Recorder doesn't work in this instance only remembering Pastespec&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My code below only gets as far as the Paste Special dialogue box &amp;amp; no further&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun C:PSTSP()
(command "PASTESPEC" "T" "T" )
(command "EXPLODE" "")
(princ)
)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2015 10:55:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/paste-special/m-p/5671352#M140926</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-10T10:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: Paste Special</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/paste-special/m-p/5671439#M140927</link>
      <description>&lt;P&gt;Hi sbanister,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the 'Pastespec' command don't have a command line version...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps alt-edited"&gt;Perhaps&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;something like this&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;will do the trick (untested)...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:demo (/ _GetClipBoardText pt str)

  (defun _GetClipBoardText (/ htmlfile result)

    ;;  Attribution: Reformatted version of
    ;;  post by Patrick_35 at theswamp.org.
    ;;
    ;;  See http://tinyurl.com/2ngf4r.

    (setq result
           (vlax-invoke
             (vlax-get
               (vlax-get
                 (setq htmlfile (vlax-create-object "htmlfile"))
                 'ParentWindow
               )
               'ClipBoardData
             )
             'GetData
             "Text"
           )
    )
    (vlax-release-object htmlfile)
    result
  )

  (if (and (setq str (_GETCLIPBOARDTEXT))
           (setq pt (getpoint "\nSpecify text start point: "))
      )
    (entmake
      (list
        (cons 0 "TEXT")
        (cons 100 "AcDbText")
        (cons 10 pt)
        (cons 40 (getvar "TEXTSIZE"))
        (cons 1 str)
        (cons 100 "AcDbText")
      )
    )
  )
  (princ)
)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps, &lt;BR /&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2015 12:08:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/paste-special/m-p/5671439#M140927</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-06-10T12:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: Paste Special</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/paste-special/m-p/5671473#M140928</link>
      <description>&lt;P&gt;Hello again hmsilva&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It does&amp;nbsp;paste as text, however if more than 1 line of the Office application is&amp;nbsp;copied (i.e. several rows from a table in Word or&amp;nbsp;Excel) it pastes as one long&lt;/P&gt;
&lt;P&gt;string instead of separate rows&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/172788i791F1CA04B972C73/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Rows to be copied from Word.JPG" title="Rows to be copied from Word.JPG" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/172792i4BAF753C31386BDF/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Result.JPG" title="Result.JPG" width="520" height="69" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Desired Result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/172791iF9F4E093A98EC277/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Desired Result.JPG" title="Desired Result.JPG" width="309" height="369" /&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2015 12:35:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/paste-special/m-p/5671473#M140928</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-10T12:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: Paste Special</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/paste-special/m-p/5672480#M140929</link>
      <description>&lt;P&gt;Hi sbanister,&lt;/P&gt;
&lt;P&gt;I don't have Office in this old laptop, so, again untested...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:demo (/ _GetClipBoardText ent_last last_ent pt str)

  (defun _GetClipBoardText (/ htmlfile result)
    ;;  Attribution: Reformatted version of
    ;;  post by Patrick_35 at theswamp.org.
    ;;
    ;;  See http://tinyurl.com/2ngf4r.
    (setq result
           (vlax-invoke
             (vlax-get
               (vlax-get
                 (setq htmlfile (vlax-create-object "htmlfile"))
                 'ParentWindow
               )
               'ClipBoardData
             )
             'GetData
             "Text"
           )
    )
    (vlax-release-object htmlfile)
    result
  )

  (if (not (setq ent_last (entlast)))
    (progn
      (entmake '(
                 (0 . "POINT")
                 (100 . "AcDbEntity")
                 (100 . "AcDbPoint")
                 (10 . (0.0 0.0 0.0))
                )
      )
      (setq ent_last (entlast)
            last_ent ent_last
      )
    )
  )
  (if (and (setq str (_GETCLIPBOARDTEXT))
           (setq pt (getpoint "\nSpecify text start point: "))
      )
    (progn
      (entmake (list
                 '(0 . "MTEXT")
                 '(100 . "AcDbEntity")
                 '(100 . "AcDbMText")
                 (cons 10 pt)
                 (cons 1 str)
               )
      )
      (command "_.explode" "_L")
    )
  )
  (if last_ent
    (entdel last_ent)
  )
  (princ)
)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps, &lt;BR /&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2015 18:47:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/paste-special/m-p/5672480#M140929</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-06-10T18:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: Paste Special</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/paste-special/m-p/5673016#M140930</link>
      <description>&lt;P&gt;Excellent! It works exacty as I anticipated&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;10/10&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jun 2015 06:57:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/paste-special/m-p/5673016#M140930</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-11T06:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Paste Special</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/paste-special/m-p/5673054#M140931</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;Excellent! It works exacty as I anticipated&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;10/10&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;sbanister, &lt;BR /&gt;glad I could help!&lt;BR /&gt;&lt;BR /&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jun 2015 08:06:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/paste-special/m-p/5673054#M140931</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-06-11T08:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Paste Special</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/paste-special/m-p/5689419#M140932</link>
      <description>Could this be edited to paste a link?</description>
      <pubDate>Tue, 23 Jun 2015 14:37:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/paste-special/m-p/5689419#M140932</guid>
      <dc:creator>Jonathan3891</dc:creator>
      <dc:date>2015-06-23T14:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Paste Special</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/paste-special/m-p/5689573#M140933</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous_dude wrote:&lt;BR /&gt;Could this be edited to paste a link?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hi DSM_dude,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do you mean, attach a 'hyperlink' to an object, using the '_GetClipBoardText' function?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2015 15:56:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/paste-special/m-p/5689573#M140933</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-06-23T15:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: Paste Special</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/paste-special/m-p/5689672#M140934</link>
      <description>No, not hyperlinks.&lt;BR /&gt;&lt;BR /&gt;When the paste special dialog box is open, it gives you two radio buttons on the left. One of them is paste link.&lt;BR /&gt;&lt;BR /&gt;I'm looking for a lisp that will select paste link then autocad entity. I thought maybe your lisp could be edited to do so.</description>
      <pubDate>Tue, 23 Jun 2015 16:42:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/paste-special/m-p/5689672#M140934</guid>
      <dc:creator>Jonathan3891</dc:creator>
      <dc:date>2015-06-23T16:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: Paste Special</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/paste-special/m-p/5689704#M140935</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous_dude wrote:&lt;BR /&gt;No, not hyperlinks.&lt;BR /&gt;&lt;BR /&gt;When the paste special dialog box is open, it gives you two radio buttons on the left. One of them is paste link.&lt;BR /&gt;&lt;BR /&gt;I'm looking for a lisp that will select paste link then autocad entity. I thought maybe your lisp could be edited to do so.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;No, the previous code just read text strings from clipboard...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;Paste link... I've never wrote &lt;SPAN class="hps"&gt;any code using 'paste link', not even know if &lt;SPAN class="hps"&gt;it will be possible&lt;/SPAN&gt; using AUTO/Visual LISP, but, I'll see what I can &lt;SPAN class="hps"&gt;do.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;&lt;SPAN class="hps"&gt;&lt;SPAN class="hps"&gt;Henrique&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2015 16:58:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/paste-special/m-p/5689704#M140935</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-06-23T16:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: Paste Special</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/paste-special/m-p/7304207#M140936</link>
      <description>&lt;P&gt;I'm waiting for this&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2017 11:00:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/paste-special/m-p/7304207#M140936</guid>
      <dc:creator>m_badran</dc:creator>
      <dc:date>2017-08-16T11:00:55Z</dc:date>
    </item>
  </channel>
</rss>

