<?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: need help with an STL exporting routine in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8892670#M86901</link>
    <description>&lt;P&gt;Henrique, when I try to run that lisp I get the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Command: ; error: malformed list on input&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Jul 2019 16:56:59 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-07-05T16:56:59Z</dc:date>
    <item>
      <title>need help with an STL exporting routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8886935#M86892</link>
      <description>&lt;P&gt;Hello all, I have an autolisp request with which maybe someone can provide assistance.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I do a lot of 3D solid modeling in Autocad 2014 and then export the solids in .stl format for use in my 3rd party rendering software. My workflow consists of creating the 3D solids in acad and keeping them all on their respective layers, then I isolate those layers and use the STLOUT command to export every 3D solid object by its layer. So basically I have layers named 3D Walls, 3D Window Frame, 3D Glass, etc., and all the solids on each of those layers are exported as .stl files. Since the STLOUT command automatically unions two or more solids when exporting, I can fairly quickly convert an entire autocad file into multiple .stl files for import into my other software to apply textures, lighting and render the final images.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The only problem with this system is it's rather tedious, since I have to manually isolate each layer, click STLOUT, select all the visible objects, click Y to the binary file question, then manually give the file to be exported a name and location, (usually 1.stl, 2.stl, 3.stl, etc. in the My Documents folder).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;What I want to be able to do is to simply click a custom icon (or invoke an autolisp routine) that will do this automatically for me without any manual input.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I want the routine to&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1.) Isolate each layer&lt;BR /&gt;2.) Export every visible solid on that layer to an .stl file with the same name as the layer that all these solids are on (so there'd be files in the My Documents folder called 3D Walls.stl, 3D Window Frame.stl, 3D Glass.stl, etc.)&lt;BR /&gt;3.) Continue this process for every layer in the drawing (usually 15-25 layers total)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have a basic grasp of Autolisp and command macros, but obviously not enough to handle this myself.&amp;nbsp; Please bear in mind that each drawing has unique layer names based on the particular subject of the drawing (not everything I do is architectural in nature), so manually entering these layer names in the lisp routine isn't really feasible.&amp;nbsp; I want the lisp routine to read each layer in the drawing and perform the exporting duties without me having to tell it what to do.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone lend a hand? Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 05:56:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8886935#M86892</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-03T05:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: need help with an STL exporting routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8889837#M86893</link>
      <description>&lt;P&gt;This is a bit rough and does not do error checking on layers frozen etc. Next version.&lt;/P&gt;&lt;PRE&gt;(defun c:ahstlout ( / lst x lay layname)
(setq lst '())
(vlax-for lay (vla-get-Layers (vla-get-activedocument (vlax-get-acad-object)))
   (setq lst (cons  (vla-get-name lay) lst))
)

(repeat (setq x (length lst))
(setq layname (nth (setq x (- x 1)) lst))
(setvar 'clayer layname)
(command "-layer" "off" "*" "" "")
(command "stlout" "all" "" "Y" "m" (strcat "D:\\acadtemp\\" "test" layname))
(command "-layer" "on" "*" "" )
)
)
(c:ahstlout)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 07:30:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8889837#M86893</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2019-07-04T07:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: need help with an STL exporting routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8891088#M86894</link>
      <description>&lt;P&gt;Sea Haven, thanks so much for doing this!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't seem to get it to work, though.&amp;nbsp; When I load the .lsp, I get the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Command: ahstlout&lt;BR /&gt;-layer&lt;BR /&gt;Current layer: "0"&lt;BR /&gt;Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: off&lt;BR /&gt;Enter name list of layer(s) to turn off or &amp;lt;select objects&amp;gt;: * Really want layer "0" (the CURRENT layer) off? &amp;lt;N&amp;gt; Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]:&lt;BR /&gt;Command: stlout&lt;BR /&gt;Select solids or watertight meshes: all 1 found&lt;/P&gt;&lt;P&gt;Select solids or watertight meshes: Create a binary STL file? [Yes/No] &amp;lt;Y&amp;gt;: Y&lt;/P&gt;&lt;P&gt;Command: m Unknown command "M". Press F1 for help.&lt;/P&gt;&lt;P&gt;Command: D:\acadtemp\test0 Unknown command "D:\ACADTEMP\TEST0". Press F1 for help.&lt;/P&gt;&lt;P&gt;Command: -layer&lt;BR /&gt;Current layer: "0"&lt;BR /&gt;Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: on&lt;BR /&gt;Enter name list of layer(s) to turn on: * Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]:&lt;BR /&gt;Command: nil&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&amp;nbsp; Thanks again!&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 20:06:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8891088#M86894</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-04T20:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: need help with an STL exporting routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8891211#M86895</link>
      <description>&lt;P&gt;I need to build a don't do layer list and check for frozen off layers. Defpoint layer in particular. It should have worked for 0 layer I used Briscad to test will try on Autocad. Is the problem the fact that I put the answer in D:\acadtemp directory you need to change it to suit you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In Briscad the stlout command asks for low, medium, high resolution will check for Autocad. try without the "M"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 23:27:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8891211#M86895</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2019-07-04T23:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: need help with an STL exporting routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8891340#M86896</link>
      <description>&lt;P&gt;Well my autocad normally defaults to &lt;STRONG&gt;C:\Users\User\Documents&lt;/STRONG&gt; when I manually save the .STLs, so I'm guessing that would be the filepath to use.&amp;nbsp; I'll give it a shot with this path and removing the "M" as you've suggested.&amp;nbsp; Thanks again!&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 02:29:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8891340#M86896</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-05T02:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: need help with an STL exporting routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8891343#M86897</link>
      <description>&lt;P&gt;Hmm, I just tried it with the aforementioned tweaks but it's still asking me for the .STL name when the Documents folder is opened instead of automatically naming the exported file and continuing on to the next layer.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 02:32:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8891343#M86897</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-05T02:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: need help with an STL exporting routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8891797#M86898</link>
      <description>&lt;P&gt;In "3D something" layers, do you have only "3D solids" or "watertight meshes" also?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 08:56:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8891797#M86898</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2019-07-05T08:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: need help with an STL exporting routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8892651#M86899</link>
      <description>&lt;P&gt;100% 3D solids.&amp;nbsp; No meshes of any kind, nor even any leftover 2D lines, arcs, text, circles, etc.&amp;nbsp; I totally purge the drawing of any unused layers, blocks and remaining "bits and pieces" before I start exporting.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 16:43:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8892651#M86899</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-05T16:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: need help with an STL exporting routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8892656#M86900</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;100% 3D solids.&amp;nbsp; No meshes of any kind, nor even any leftover 2D lines, arcs, text, circles, etc.&amp;nbsp; I totally purge the drawing of any unused layers, blocks and remaining "bits and pieces" before I start exporting.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Will save in the current dwg folder.&lt;/P&gt;
&lt;P&gt;As a 'demo'...&lt;/P&gt;
&lt;PRE&gt;(defun c:demo (/ *error* base layname laylst name newfilename oldfdia ss)&lt;BR /&gt;&amp;nbsp; (vl-load-com)&lt;BR /&gt;&amp;nbsp; (defun *error* (msg)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (if&amp;nbsp;oldfdia&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setvar 'FILEDIA oldfdia)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (cond ((not msg))&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ((member msg '("Function cancelled" "quit / exit abort")))&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ((princ (strcat "\n** Error: " msg " ** ")))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (princ)&lt;BR /&gt;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp; (vlax-for lay (vla-get-Layers (vla-get-activedocument (vlax-get-acad-object)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (if&amp;nbsp;(wcmatch (setq name (vla-get-name lay)) "3D*")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq laylst (cons name laylst))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp; (if (/= laylst nil)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (progn&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq oldfdia (getvar 'FILEDIA)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; base&amp;nbsp;&amp;nbsp;&amp;nbsp; (strcat (getvar 'DWGPREFIX) (vl-filename-base (getvar 'DWGNAME)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setvar 'FILEDIA 0)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (foreach layname laylst&lt;BR /&gt;&amp;nbsp;(if (setq ss (ssget "_X" (list (cons 8 layname) '(0 . "3DSOLID"))))&lt;BR /&gt;&amp;nbsp;&amp;nbsp; (if (findfile (setq newfilename (strcat base " - " layname)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (command "_stlout" ss "" "_Y" newfilename "_y")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (command "_stlout" ss "" "_Y" newfilename)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setvar 'FILEDIA oldfdia)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp; (princ)&lt;BR /&gt;)&lt;/PRE&gt;
&lt;P&gt;&lt;FONT color="#ff0000"&gt;Edited...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Hope this helps, &lt;BR /&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 17:07:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8892656#M86900</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2019-07-05T17:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: need help with an STL exporting routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8892670#M86901</link>
      <description>&lt;P&gt;Henrique, when I try to run that lisp I get the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Command: ; error: malformed list on input&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 16:56:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8892670#M86901</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-05T16:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: need help with an STL exporting routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8894630#M86902</link>
      <description>&lt;P&gt;It worked for me I tested on Briscad had to add about low, med, high, will look at check for Autocad v's another cad.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;also&amp;nbsp;&lt;FONT&gt;(if (wcmatch (setq name (strcase (vla-get-name lay))) "3D*")&lt;/FONT&gt; the strcase means it will work with 3d or 3D layer names.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 01:39:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8894630#M86902</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2019-07-08T01:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: need help with an STL exporting routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8902494#M86903</link>
      <description>&lt;P&gt;Ok when I load that lisp, it loads fine.&amp;nbsp; I then type "DEMO" and hit enter.&amp;nbsp; There's a brief half a second pause, as if autocad is doing something, then...nothing happens.&amp;nbsp; No .stl files are created anywhere on my computer, no layers are turned off or on, nothing.&amp;nbsp; Am I doing something wrong here?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 23:15:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8902494#M86903</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-10T23:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: need help with an STL exporting routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8902952#M86904</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Ok when I load that lisp, it loads fine.&amp;nbsp; I then type "DEMO" and hit enter.&amp;nbsp; There's a brief half a second pause, as if autocad is doing something, then...nothing happens.&amp;nbsp; No .stl files are created anywhere on my computer, no layers are turned off or on, nothing.&amp;nbsp; Am I doing something wrong here?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Post&amp;nbsp;a sample&amp;nbsp;DWG file.&lt;/P&gt;
&lt;P&gt;The 'demo' should create a *.stl file for each 3D*layer in the dwg file...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 07:26:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8902952#M86904</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2019-07-11T07:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: need help with an STL exporting routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8902987#M86905</link>
      <description>&lt;P&gt;Wait a minute, it DOES work!&amp;nbsp; Wow, that's pretty amazing.&amp;nbsp; It converted an entire dwg with 25 layers in less than 15 seconds and with a single click!&amp;nbsp; Fantastic!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Two little changes if possible then I think this routine is exactly what I needed:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.)&amp;nbsp; Can you make it so the .stl files are saved in this folder "C:\Users\User\Documents"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2.)&amp;nbsp; Can you remove the drawing name prefix from the .stl files?&amp;nbsp; So instead of "export test - 3D Glass.stl" the file is simply named "3D Glass.stl"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for this!!!!&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>Thu, 11 Jul 2019 07:46:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8902987#M86905</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-11T07:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: need help with an STL exporting routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8903075#M86906</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Wait a minute, it DOES work!&amp;nbsp; Wow, that's pretty amazing.&amp;nbsp; It converted an entire dwg with 25 layers in less than 15 seconds and with a single click!&amp;nbsp; Fantastic!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Two little changes if possible then I think this routine is exactly what I needed:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.)&amp;nbsp; Can you make it so the .stl files are saved in this folder "C:\Users\User\Documents"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2.)&amp;nbsp; Can you remove the drawing name prefix from the .stl files?&amp;nbsp; So instead of "export test - 3D Glass.stl" the file is simply named "3D Glass.stl"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you so much for this!!!!&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;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You're welcome.&lt;BR /&gt;'demo' revised to save the files in user documents folder, removed the prefix, and ad &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6254908"&gt;@Sea-Haven&lt;/a&gt;&amp;nbsp;'s 'strcase' advice...&lt;/P&gt;
&lt;PRE&gt;(defun c:demo (/ *error* base layname laylst name newfilename oldfdia ss)
  (vl-load-com)
  (defun *error* (msg)
    (if	oldfdia
      (setvar 'FILEDIA oldfdia)
    )
    (cond ((not msg))
	  ((member msg '("Function cancelled" "quit / exit abort")))
	  ((princ (strcat "\n** Error: " msg " ** ")))
    )
    (princ)
  )
  (vlax-for lay (vla-get-Layers (vla-get-activedocument (vlax-get-acad-object)))
    (if	(wcmatch (setq name (strcase (vla-get-name lay))) "3D*")
      (setq laylst (cons name laylst))
    )
  )
  (if (/= laylst nil)
    (progn
      (setq oldfdia (getvar 'FILEDIA)
	    base    (strcat "C:\\Users\\" (getenv "username") "\\Documents\\")
      )
      (setvar 'FILEDIA 0)
      (foreach layname laylst
	(if (setq ss (ssget "_X" (list (cons 8 layname) '(0 . "3DSOLID"))))
	  (if (findfile (setq newfilename (strcat base layname ".stl")))
	    (command "_stlout" ss "" "_Y" newfilename "_y")
	    (command "_stlout" ss "" "_Y" newfilename)
	  )
	)
      )
      (setvar 'FILEDIA oldfdia)
    )
  )
  (princ)
)&lt;/PRE&gt;
&lt;P&gt;Hope this helps, &lt;BR /&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 08:31:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8903075#M86906</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2019-07-11T08:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: need help with an STL exporting routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8904259#M86907</link>
      <description>&lt;P&gt;And with that, it now works PERFECTLY.&amp;nbsp; You guys are awesome!!&amp;nbsp; This will save me THOUSANDS of clicks per month.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;THANK YOU SO MUCH!!!!!&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 16:33:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8904259#M86907</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-11T16:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: need help with an STL exporting routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8904264#M86908</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;And with that, it now works PERFECTLY.&amp;nbsp; You guys are awesome!!&amp;nbsp; This will save me THOUSANDS of clicks per month.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;THANK YOU SO MUCH!!!!!&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You're welcome, @Anonymous&amp;nbsp; !&lt;BR /&gt;Glad I could help&lt;BR /&gt;&lt;BR /&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 16:36:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8904264#M86908</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2019-07-11T16:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: need help with an STL exporting routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8959615#M86909</link>
      <description>&lt;P&gt;Well after a few weeks of using this lisp routine with no trouble whatsoever, suddenly it no longer works!&amp;nbsp; I have no idea what I did, either.&amp;nbsp; I didn't update windows 10, I'm still using acad 2014, and the procedures I used before are what I'm still currently using.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I load this lisp, it tells me the routine was loaded successfully.&amp;nbsp; When I then attempt to use the command, acad pauses for a brief moment, maybe 1 second, then...nothing.&amp;nbsp; No errors reported, no string of text to be seen, even when I hit F2, and no STLs have been exported.&amp;nbsp; The command "runs" presumably but nothing actually happens.&amp;nbsp; I can't even copy/paste the error code because THERE'S NOTHING TO COPY.&amp;nbsp;&amp;nbsp; The command line just goes back to "Command:" with nothing further to show.&amp;nbsp; I'm at a total loss for an explanation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone care to shed some light on this?&amp;nbsp; Other lisp routines still work fine, only this one is "dead" when I run the command.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Aug 2019 06:54:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8959615#M86909</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-11T06:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: need help with an STL exporting routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8959660#M86910</link>
      <description>&lt;P&gt;You could load the code into VLIDE 1st step do the check code should not be any errors, no Autocad at moment else would explain more&amp;nbsp; but can do break on error and look at the code that is causing error. You can also inspect each variable and see what its value is.&lt;/P&gt;</description>
      <pubDate>Sun, 11 Aug 2019 08:40:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8959660#M86910</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2019-08-11T08:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: need help with an STL exporting routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8959997#M86911</link>
      <description>&lt;P&gt;I figured it out.&amp;nbsp; I was trying to export solids that WERE NOT named with the "3D" prefix.&amp;nbsp; Once I changed the layer names to have "3D" in front of them, everything works fine again.&amp;nbsp; lol&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again guys!!&lt;/P&gt;</description>
      <pubDate>Sun, 11 Aug 2019 18:48:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-with-an-stl-exporting-routine/m-p/8959997#M86911</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-11T18:48:38Z</dc:date>
    </item>
  </channel>
</rss>

