BOM script
 1-20  21-32

Next
 From:  Mik (MIKULAS)
7759.1 
Hi all,

Does exists some "BOM script" (Bill Of Materials)?
It will be enough script, which exports list to TXT of all named and visible objects in this syntax for instance: Object Name;Number;Type of construction (solid, curve, closed curve, etc...), which can be seen on "Info Panel".




Thanks
Mik
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:  Michael Gibson
7759.2 In reply to 7759.1 
Hi Mik, re: BOM script - the closest thing to that is probably the attached script which I recently wrote for someone else, it allows you to select solids and then it will generate a .csv file similar to what you describe, the file can then be imported into a spreadsheet program.

This type of thing will probably work better in the future when MoI has an "instancing" mechanism in it.

- Michael

EDIT: 4/30/2017 - Updated CutList.js to work with locales that use commas as decimal separator

EDITED: 30 Apr 2017 by MICHAEL GIBSON

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)
7759.3 In reply to 7759.2 
This is it, Michael!

Thank you very much.

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:  Frenchy Pilou (PILOU)
7759.4 
Have you a little image of a possible result for some objects ?
---
Pilou
Is beautiful that please without concept!
My Gallery
  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
7759.5 In reply to 7759.4 
Hi Pilou, it doesn't make any result in MoI, it makes a .csv text file which can then be opened with a spreadsheet program like Excel.

- 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:  Frenchy Pilou (PILOU)
7759.6 In reply to 7759.5 
Yes it's the example image "Moi Objects Start / Result in Excel end"
for have an idea! Now I have just the Up Corner page ot the first post! :)

EDITED: 30 Apr 2017 by PILOU

  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
7759.7 In reply to 7759.6 
Hi Pilou, sorry I don't have any image prepared for that. If someone is asking for a .csv file it's pretty much guaranteed that they already know what a spreadsheet looks like, so making an image of one wouldn't really do anything helpful for them.

- 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:  Frenchy Pilou (PILOU)
7759.8 In reply to 7759.7 
Yes but it was just for make a little article in section Utilities or Script / Plugins of my site! :)
I will see that i can make!
  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:  Frenchy Pilou (PILOU)
7759.9 
Seems curves are not taken in count!
And there is problem with accents! ;)

(import inside excel made without format) :)

EDITED: 30 Apr 2017 by PILOU

  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
7759.10 In reply to 7759.9 
Hi Pilou, yes both of those are normal - curves don't correspond to a finished object that will be correspond so the script only gathers up solids. It could be modified easily to look for curves also though if you had some use for that. And also usually a .csv file is just a plain ascii text file and so can't contain accented characters. It might work with some programs though, what spreadsheet program are you using to read it in?

- 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:  Frenchy Pilou (PILOU)
7759.11 
<< what spreadsheet program are you using to read it in?
Refound Excel on my computer! ;)

Does it possible to link CutList with the CVolume of Max Smirnov ?

http://moi3d.com/forum/index.php?webtag=MOI&msg=7421.71

  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
7759.12 In reply to 7759.9 
Hi Pilou, also what happens with your accented characters if you open the .csv file in Notepad, do they display ok there?

If so try saving it out again from Notepad using the Encoding UTF-8 option on the Notepad save dialog, your new file will contain a "Byte Order Mark" at the front of it which may then get recognized by your spreadsheet program.

- 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:  Frenchy Pilou (PILOU)
7759.13 In reply to 7759.12 
Yes good accents are visible on the Notepad! :)

Ok perfect!

Waiting the CVolume by Max! :)

EDITED: 30 Apr 2017 by PILOU

  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
7759.14 In reply to 7759.11 
Hi Pilou,

> Does it possible to link it with the CVolume of Max Smirnov ?

It could be possible, you'd need to copy the volume calculation code into the .csv generator script.

- 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:  Michael Gibson
7759.15 In reply to 7759.13 
Hi Pilou,

re:
> Yes good accents are visible on the Notepad! :)

So that means your text file is ok (meaning it has UTF-8 text data in it), it's just that Excel doesn't interpret it as UTF-8 text using the regular file open method.

You could try saving it out from Notepad as UTF-8 which will put the Byte Order Mark at the front of the file which may get Excel to read it as UTF-8 text, or you could try using the Data > From Text method in Excel to read it which I think has a way to specify that it's UTF-8 text as described here:
https://www.itg.ias.edu/content/how-import-csv-file-uses-utf-8-character-encoding-0

- 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:  Frenchy Pilou (PILOU)
7759.16 In reply to 7759.15 
Seems Excel accept directly (Ansi from the Moi Cutlist modified in Notpad in UTF8)

Just Sphere has extra measures ! ?

  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:  Frenchy Pilou (PILOU)
7759.17 
The original file 3dm (With Curve, Sphere, Box, Cylinder)

http://moiscript.weebly.com/uploads/3/9/3/8/3938813/cutlist.3dm

From the CVolume by Max there are Volume, Surface , Mass, Density, Material and Center of Mass! :)

EDITED: 30 Apr 2017 by PILOU

  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
7759.18 In reply to 7759.16 
Hi Pilou,

re: Just Sphere has extra measures ! ?

Looks like that's because of the French way of having commas for the decimal point separator. Since commas are also used as item separators in the .csv file that makes Excel think there are more columns there.

This can be fixed by tuning up the CutList.js script file, on lines 31-33 of the script there's this currently:

code:
		cutobj.x = moi.ui.formatCoordinate( bbox.xLength, 6 );
		cutobj.y = moi.ui.formatCoordinate( bbox.yLength, 6 );
		cutobj.z = moi.ui.formatCoordinate( bbox.zLength, 6 );


Try replacing those lines with this instead and see if that fixes it:

code:
		cutobj.x = moi.ui.formatCoordinate( bbox.xLength, 6 ).replace( ',' , '.' );
		cutobj.y = moi.ui.formatCoordinate( bbox.yLength, 6 ).replace( ',' , '.' );
		cutobj.z = moi.ui.formatCoordinate( bbox.zLength, 6 ).replace( ',' , '.' );


- 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:  Frenchy Pilou (PILOU)
7759.19 
Yes the famous "decimal" point! :)

It's with little things like that billions are losted in reality in Space discovery with satellites, space rockets etc...!
  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:  Frenchy Pilou (PILOU)
7759.20 
<< Try replacing those lines with this instead and see if that fixes it:

So perfect!
(I believe that this Moi export who is regulated on Ansi for any reason)


I am affraid that was a littme more difficult for the CVolume... :)



PS
This correction will works also for people who have not decimal point problem
or we must have 2 versions ?
  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

 

 
Show messages:  1-20  21-32