
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello all, I have an autolisp request with which maybe someone can provide assistance.
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.
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).
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.
I want the routine to
1.) Isolate each layer
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.)
3.) Continue this process for every layer in the drawing (usually 15-25 layers total)
I have a basic grasp of Autolisp and command macros, but obviously not enough to handle this myself. 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. 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.
Can anyone lend a hand? Thanks in advance!
Solved! Go to Solution.