<?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: Wblock Lisp in AutoCAD Forum</title>
    <link>https://forums.autodesk.com/t5/autocad-forum/wblock-lisp/m-p/5883782#M305242</link>
    <description>&lt;P&gt;It seems to be working for me now i have removed&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(eq (cdr (assoc 0 (entget enTxt))) "TEXT")&lt;/PRE&gt;</description>
    <pubDate>Thu, 29 Oct 2015 13:30:22 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-10-29T13:30:22Z</dc:date>
    <item>
      <title>Wblock Lisp</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/wblock-lisp/m-p/5883629#M305239</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have got a drawing that has got about 500 blocks in it and i need to wblock them out one by one&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;They have all got text above them that gives the name that i want to use for the block name then i just need to select the objects and the insersion point of the block&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have found a lisp on the fourms that seems to work for other people but it doesnt seem to work for me it asks me to select the block name text i select it and then it doesnt do anything else&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun c:qwblock (/ DIR ENTXT SS TXT PT TXT0)
  (setq Dir (getvar "DWGPREFIX"))
  (vl-cmdf "_undo" "be")
  (while (AND (vl-file-directory-p Dir)
       (setq enTxt (car(entsel "\nSelect Block name Text: ")))
       (eq (cdr (assoc 0 (entget enTxt))) "TEXT")
       (setq txt0 (cdr (assoc 1 (entget enTxt))))
       (not (findfile (setq txt (strcat Dir txt0))))
       (setq pt (getpoint "\nPick Insertion Point: "))
       (setq ss (ssget))
       )
    (progn
      (vl-cmdf "_undo" "mark")
      (vl-cmdf "_move" ss "" pt "0,0,0")
      (vl-cmdf "_zoom" "object" "p" "")
      (vl-cmdf "_-wblock" txt "" pt ss "")
      (vl-cmdf "_undo" "back")
      )
    )
  (vl-cmdf "_undo" "end")
  (princ)
  )&lt;/PRE&gt;&lt;P&gt;Would anyone be able to help me to get this to work ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tia&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2015 12:14:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/wblock-lisp/m-p/5883629#M305239</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-29T12:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: Wblock Lisp</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/wblock-lisp/m-p/5883668#M305240</link>
      <description>&lt;P&gt;Works, save the block in the same folder dwg.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2015 12:40:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/wblock-lisp/m-p/5883668#M305240</guid>
      <dc:creator>regisrohde</dc:creator>
      <dc:date>2015-10-29T12:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: Wblock Lisp</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/wblock-lisp/m-p/5883770#M305241</link>
      <description>&lt;P&gt;doesnt seem to be working for me for some reason&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i run the command qwblock&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;click on the text that i want to use for the block name and it doesnt do anything&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;heres whats in the command window&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Command: QWBLOCK&lt;/P&gt;&lt;P&gt;Select Block name Text:&lt;BR /&gt;Command:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If i remove some of the lisp it lets me select the text and then objects and insersion point but it wont output the block because its not passing all the information to be able to save it&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is what i removed and it allows me to do the above&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(eq (cdr (assoc 0 (entget enTxt))) "TEXT")&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2015 13:27:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/wblock-lisp/m-p/5883770#M305241</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-29T13:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: Wblock Lisp</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/wblock-lisp/m-p/5883782#M305242</link>
      <description>&lt;P&gt;It seems to be working for me now i have removed&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(eq (cdr (assoc 0 (entget enTxt))) "TEXT")&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Oct 2015 13:30:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/wblock-lisp/m-p/5883782#M305242</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-29T13:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: Wblock Lisp</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/wblock-lisp/m-p/5883848#M305243</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;It seems to be working for me now i have removed&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(eq (cdr (assoc 0 (entget enTxt))) "TEXT")&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Were you perhaps selecting an &lt;EM&gt;Mtext&lt;/EM&gt; object, instead of Text? &amp;nbsp;That would stop the whole thing, because the (and) function would return nil.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that's the issue, but you want to allow &lt;EM&gt;either&lt;/EM&gt; Text or Mtext, you could replace the above with:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;(&lt;FONT color="#FF0000"&gt;wcmatch&lt;/FONT&gt; (cdr (assoc 0 (entget enTxt))) "&lt;FONT color="#FF0000"&gt;*&lt;/FONT&gt;TEXT")&lt;/PRE&gt;
&lt;P&gt;which would allow either, but it would just quietly stop if you picked, say, a Line, rather than giving you some kind of error from trying to get text content from such a thing, or look for a file name that's only a directory name because no text content is added to the end of it.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2015 13:58:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/wblock-lisp/m-p/5883848#M305243</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2015-10-29T13:58:51Z</dc:date>
    </item>
  </channel>
</rss>

