<?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: Create lisp in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/create-lisp/m-p/11409152#M41247</link>
    <description>&lt;P&gt;this will allow you to do a single click selecting only MTEXT on the current Layer:&lt;/P&gt;&lt;P&gt;(setq s(ssget "_+.:E:S" (list(cons 0 "MTEXT")(cons 8 (getvar"clayer")))))&lt;/P&gt;&lt;P&gt;this will do a save:&lt;/P&gt;&lt;P&gt;(command"_.QSAVE")&lt;/P&gt;&lt;P&gt;this will close drawing:&lt;/P&gt;&lt;P&gt;(command"_.CLOSE")&lt;/P&gt;&lt;P&gt;To apply your code to multiple drawings, create a SCRIPT file (name with .SCR file extension) that includes loading of your lisp routine and running the command ie:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(load"MtextUnformat")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;MtextUnformat&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then download the free AutoScript app to have this script file applied to multiple drawings:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.cadig.com/products/autocad-script-pro.php" target="_blank" rel="noopener"&gt;https://www.cadig.com/products/autocad-script-pro.php&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But you'll have to modify your code because it won't pause for you to select your MTEXT.&lt;/P&gt;&lt;P&gt;You can change it so that it just selects ALL MText on the current Layer and then cycle through those MText objects selected (if any) to apply the rest of your code:&lt;/P&gt;&lt;P&gt;(setq s(ssget "_X" (list (cons 0 "MTEXT") (cons 8 (getvar"clayer")))))&lt;/P&gt;</description>
    <pubDate>Thu, 08 Sep 2022 15:49:57 GMT</pubDate>
    <dc:creator>paullimapa</dc:creator>
    <dc:date>2022-09-08T15:49:57Z</dc:date>
    <item>
      <title>Create lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/create-lisp/m-p/11406980#M41241</link>
      <description>&lt;P&gt;Hi, can someone help me create a lisp that goes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lisp (least clicking)&lt;/P&gt;&lt;P&gt;ssget (_x) [select objects layer]&lt;/P&gt;&lt;P&gt;Saveas&lt;/P&gt;&lt;P&gt;Close&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 19:35:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/create-lisp/m-p/11406980#M41241</guid>
      <dc:creator>pkambhampati7FA2R</dc:creator>
      <dc:date>2022-09-07T19:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: Create lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/create-lisp/m-p/11407016#M41242</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12862614"&gt;@pkambhampati7FA2R&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;ssget (_x) [select objects layer]&lt;/P&gt;
&lt;P&gt;Saveas&lt;/P&gt;
&lt;P&gt;Close&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It's not clear to me what you intend.&amp;nbsp; Is it to have the routine select all objects on the Layer of a selected object, and send them off to a separate drawing file?&amp;nbsp; [That would involve a WBLOCK rather than a SAVEAS command.]&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 19:52:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/create-lisp/m-p/11407016#M41242</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2022-09-07T19:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: Create lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/create-lisp/m-p/11407036#M41243</link>
      <description>&lt;P&gt;Thanks for responding!! I have found a way to unformat the mtext in a file, using a lisp:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun c:MtextUnformat ( / e i e)&lt;/P&gt;&lt;P&gt;(if (setq s (ssget '((0 . "MTEXT"))))&lt;BR /&gt;(repeat (setq i (sslength s))&lt;BR /&gt;(setq e (ssname s (setq i (1- i))))&lt;BR /&gt;(setpropertyvalue e "Contents"&lt;BR /&gt;(getpropertyvalue e "Text"))))&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I want something with least clicks that just selects objects by their layers, saves and closes.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 20:03:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/create-lisp/m-p/11407036#M41243</guid>
      <dc:creator>pkambhampati7FA2R</dc:creator>
      <dc:date>2022-09-07T20:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Create lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/create-lisp/m-p/11407104#M41244</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12862614"&gt;@pkambhampati7FA2R&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;.... I want something with least clicks that just selects objects by their layers, saves and closes.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's part of what I don't understand--you don't say anything about what to do with the objects selected.&amp;nbsp; What do you really mean by "just selects objects by their layers"?&amp;nbsp; Does the User select some object, and the routine finds everything else on the same Layer as that object?&amp;nbsp; Does the routine step through all Layers, finding everything on each Layer in turn, and do something with them for each Layer's worth, without User input?&amp;nbsp; What do you mean by "saves"?&amp;nbsp; Saves the selected objects on a given Layer out to another drawing?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 20:47:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/create-lisp/m-p/11407104#M41244</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2022-09-07T20:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: Create lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/create-lisp/m-p/11407116#M41245</link>
      <description>&lt;P&gt;Sorry I wasn't clear. I meant saving in the same drawing. However, I'd like to know if there's a way to do that to multiple CAD drawings at once.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 20:51:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/create-lisp/m-p/11407116#M41245</guid>
      <dc:creator>pkambhampati7FA2R</dc:creator>
      <dc:date>2022-09-07T20:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: Create lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/create-lisp/m-p/11407413#M41246</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12862614"&gt;@pkambhampati7FA2R&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;..... I meant saving in the same drawing. ....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;How does selecting objects by their Layers relate to that?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2022 01:23:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/create-lisp/m-p/11407413#M41246</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2022-09-08T01:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Create lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/create-lisp/m-p/11409152#M41247</link>
      <description>&lt;P&gt;this will allow you to do a single click selecting only MTEXT on the current Layer:&lt;/P&gt;&lt;P&gt;(setq s(ssget "_+.:E:S" (list(cons 0 "MTEXT")(cons 8 (getvar"clayer")))))&lt;/P&gt;&lt;P&gt;this will do a save:&lt;/P&gt;&lt;P&gt;(command"_.QSAVE")&lt;/P&gt;&lt;P&gt;this will close drawing:&lt;/P&gt;&lt;P&gt;(command"_.CLOSE")&lt;/P&gt;&lt;P&gt;To apply your code to multiple drawings, create a SCRIPT file (name with .SCR file extension) that includes loading of your lisp routine and running the command ie:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(load"MtextUnformat")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;MtextUnformat&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then download the free AutoScript app to have this script file applied to multiple drawings:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.cadig.com/products/autocad-script-pro.php" target="_blank" rel="noopener"&gt;https://www.cadig.com/products/autocad-script-pro.php&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But you'll have to modify your code because it won't pause for you to select your MTEXT.&lt;/P&gt;&lt;P&gt;You can change it so that it just selects ALL MText on the current Layer and then cycle through those MText objects selected (if any) to apply the rest of your code:&lt;/P&gt;&lt;P&gt;(setq s(ssget "_X" (list (cons 0 "MTEXT") (cons 8 (getvar"clayer")))))&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2022 15:49:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/create-lisp/m-p/11409152#M41247</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2022-09-08T15:49:57Z</dc:date>
    </item>
  </channel>
</rss>

