Full Version: Export multiple parts

From: r2d3 [#1]
 11 Sep
To: ALL

I use MOI mostly for 3d printing projects - and i love it!
Just want to share a little but usefull script i wrote to export different parts of my drawing to the slicer.

Install it to your command folder -> EDIT THE PATH TO YOUR FAVOURITE FOLDER in the ExportParts.js -> make a shortcut (Cmd-E ExportParts)-> make sure that the parts you like to export have a unique name -> select them -> hit Cmd-E -> select the export format -> Okay -> check the settings for each part and you will find the exported files in your favourit folder.

THX to the community and Michael for having MOI (cant wait for V4 :-)

Attachments:
exportparts.zip

Reply


From: Mik (MIKULAS) [#2]
 21 Sep
To: ALL

Hi r2d3, Michael

very useful script for assemblies too. Is it possible to rewrite this script, so that I can chose other format (STEP, IGES, ...)?
It would be perfect to find standard Export dialog window after selecting parts and run the script, where it can be chose save location and format.

Thanks
Mik

Reply


From: Michael Gibson [#3]
 21 Sep
To: ALL

Hi Mik,

> It would be perfect to find standard Export dialog window after selecting parts and run
> the script, where it can be chose save location and format.

The problem here is the standard Export dialog window is focused on picking a file name. But this script doesn't write to a single file name, it uses object names as the file names. So if the standard Export dialog was to be shown, the name you entered in there would not actually be used.

For additional formats, I think if you modify the list in ExportParts.htm it should work. It currently has this:

code:
	<option value=".3dm">3dm</option>
	<option value=".stl">stl</option>
	<option value=".obj">obj</option>


Try adding to that list like if you want STEP and IGES formats put it in like this:
code:
	<option value=".3dm">3dm</option>
	<option value=".stl">stl</option>
	<option value=".obj">obj</option>
	<option value=".stp">STEP</option>
	<option value=".igs">IGES</option>


- Michael

Reply


From: Mik (MIKULAS) [#4]
 22 Sep
To: ALL

Hi Michael,

it works!

Thanks a lot!

Mik

Reply


From: grandpi (PIERREARCHI) [#5]
 26 Sep
To: ALL

Hello,

Very uselful script for me when i have to export 3d model with "50 parts" from a customer order.

1) How could i choose the file folder export ???? (impossible to understand in which folder the files go (or it doesn't work) !!!.
2) Is it possible to have an .skp export ?
3) How could i add the java program code line to have more export pmossibilities ??

Pierre

Reply


From: Michael Gibson [#6]
 27 Sep
To: ALL

Hi Pierre,

re:
> 1) How could i choose the file folder export ???? (impossible to understand in which
> folder the files go (or it doesn't work) !!!.

For this particular script you have to open the file ExportParts.js and edit line 5 which currently reads:

code:
var pf="/Users/username/Documents/CAD/"; //change this path to your needs!!!


The path that is in there currently is a Mac path, for Windows you'd need to to use \ backslash characters and then the tricky part is you actually need to use 2 backslash characters \\ for each one because in JavaScript strings the backslash is an escape character to make stuff like \r meaning return or \t meaning tab. So on Windows you'd make it like this:

code:
var pf="c:\\ExportPartsDir\\";



re:
> 2) Is it possible to have an .skp export ?

Yes it should be, you'd need to add an entry to the file type dropdown which is in the ExportParts.htm file, similar to what's described here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=8582.3

For SKP format add another line like this:
code:
<option value=".skp">SKP</option>


re:
> 3) How could i add the java program code line to have more export pmossibilities ??

It has to go in the ExportParts.htm file which is the UI part of the script, you need to add more entries to the select dropdown in there.

Please let me know if you're still stuck.

- Michael

Reply


From: grandpi (PIERREARCHI) [#7]
 27 Sep
To: ALL

Thank you Michael. Im going to try.
Regards,
Pierre.

Reply


From: r2d3 [#8]
 11 Oct
To: ALL

Thank you Michael for answering the questions to my script!
I was in holiday... :-)
But all you answers have been RIGHT! ;-)

THX
Ralf

Reply


Reply to All

Back to thread list | Login

© 2017 Project Beehive Forum