BOM script
 1-11  12-31  32

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

Previous
Next
 From:  bemfarmer
7759.21 In reply to 7759.20 
The comma replace modification, (Euro version), works fine with MoI solids in US version of MoI.
There are not any commas to replace, as commas are not used to separate thousands in the MoI numbers.
In Excel, format can add in the thousands comma, if needed for a gigantic solid object.
CutList is a nice little script!
- Brian
  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.22 In reply to 7759.20 
Hi Pilou, yes the update should work for all cases, both with comma decimals and period decimals. I've updated the script in the original message with the fix.

- 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.23 In reply to 7759.22 
THX for all!
---
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:  Frenchy Pilou (PILOU)
7759.24 
Another little trap!

For a French version, what is the trick for messages, tittle etc...where there are " ' " like inside "Nom d'Objet" ?
Because this result a glitch inside Moi! :)
  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.25 In reply to 7759.24 
Hi Pilou, you mean for a string in script that is surrounded by single quote marks, like:

fs.writeLine( 'ObjName,StyleName,Quantity,X,Y,Z' );

If you want to put one of those same marks inside the string you have to escape it with a \ character before it like this:

fs.writeLine( 'Nom d\'Objet,StyleName,Quantity,X,Y,Z' );

When you put the \ character before it, it will tell the script parser not to end the string there.

- 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.26 In reply to 7759.25 
Ok that works!
but something curious
the previous trick to save in UTF8 for have accents given in Moi Names' Object don't work more
and give Parse Error in Moi Line 1 who is a blank line !!!
  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.27 In reply to 7759.26 
Hi Pilou, do you only get the error with the script which you've edited? Please try the original script from above and see if that works ok. If so, please post your edited French version maybe there's something wrong with one of your changes.

- 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.28 In reply to 7759.27 
  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.29 In reply to 7759.28 
Hi Pilou, for .js files to contain unicode in MoI v3 only UTF-16 with byte order mark is currently supported. This will be tuned up in v4 so that UTF-8 is supported too.

- 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.30 In reply to 7759.29 
So I will try with Notepad ++ :)

so NotePad ++ codes as UTf16 LE (what is LE / BE ?)
So Js for Moi works!

then Notepad export csv as UTF 8 !:)
So accents will all taken in count for Excel (because accents UTF 16 don't works with excel! )
What a gymnastic! :)

Accents are a calamity! :)

Now success!



Version Vf
http://moiscript.weebly.com/cutlist.html

EDITED: 2 May 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.31 In reply to 7759.30 
Hi Pilou,

re:
> (what is LE / BE ?)

That stands for "Little Endian" or "Big Endian", which are ways that different computers order bytes within longer integer values: https://en.wikipedia.org/wiki/Endianness . You want the "Little Endian" one.

For MoI v4 I can add in an option for script text file creation to write the Byte Order Mark at the start of the .csv file so you wouldn't have to do the extra step there. You can also probably use the Data > From text file option in Excel which will let you tell it that it's a comma delimited UTF-8 file without having to send it through Notepad++ .

- 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
 

Reply to All Reply to All

 

 
Show messages:  1-11  12-31  32