Export multiple parts

Next
 From:  r2d3
8582.1 
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:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Mik (MIKULAS)
8582.2 In reply to 8582.1 
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 Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
8582.3 In reply to 8582.2 
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 Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Mik (MIKULAS)
8582.4 In reply to 8582.3 
Hi Michael,

it works!

Thanks a lot!

Mik
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  grandpi (PIERREARCHI)
8582.5 
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

EDITED: 26 Sep 2017 by PIERREARCHI

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
8582.6 In reply to 8582.5 
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 Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  grandpi (PIERREARCHI)
8582.7 In reply to 8582.6 
Thank you Michael. Im going to try.
Regards,
Pierre.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  r2d3
8582.8 
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 More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All