MoI discussion forum
MoI discussion forum

Full Version: Export multiple parts

Show messages: All  1  2-8

From: Mik (MIKULAS)
21 Sep 2017   [#2] In reply to [#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
From: Michael Gibson
21 Sep 2017   [#3] In reply to [#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
From: Mik (MIKULAS)
22 Sep 2017   [#4] In reply to [#3]
Hi Michael,

it works!

Thanks a lot!

Mik
From: grandpi (PIERREARCHI)
26 Sep 2017   [#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
From: Michael Gibson
27 Sep 2017   [#6] In reply to [#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
From: grandpi (PIERREARCHI)
27 Sep 2017   [#7] In reply to [#6]
Thank you Michael. Im going to try.
Regards,
Pierre.
From: r2d3
11 Oct 2017   [#8]
Thank you Michael for answering the questions to my script!
I was in holiday... :-)
But all you answers have been RIGHT! ;-)

THX
Ralf

Show messages: All  1  2-8