Show messages:
1-17
18-37
38-41
From: Michael Gibson
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
From: Frenchy Pilou (PILOU)
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...!
From: Frenchy Pilou (PILOU)
<< 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 ?
From: bemfarmer
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
From: Michael Gibson
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
From: Frenchy Pilou (PILOU)
THX for all!
From: Frenchy Pilou (PILOU)
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! :)
From: Michael Gibson
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
From: Frenchy Pilou (PILOU)
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 !!!
From: Michael Gibson
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
From: Frenchy Pilou (PILOU)
So here the file saved as UTF-8
http://moiscript.weebly.com/uploads/3/9/3/8/3938813/cutlistfr.js
and the 3Dm
https://3938813-177191628195407167.preview.editmysite.com/uploads/3/9/3/8/3938813/cutlistfr.3dm
From: Michael Gibson
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
From: Frenchy Pilou (PILOU)
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
From: Michael Gibson
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
From: Frenchy Pilou (PILOU)
THx for the infos!
Amazing complexity!
From: MarK
Hi Michael, this is more than I expected... Do you think the script could also assemble the parts according to dimensions (regardless of the orientation in the model) and round the dimensions to integers as I describe in the attached image?
Image Attachments:
test.jpg
From: Frenchy Pilou (PILOU)
When you have even an image of your results! (like the above)
I believe you can ask anything you want to any Ai...
This free one is very cool for this sort of thing...just give it the good question(s) ! :)
That avoid some coding! :)
https://gemini.google.com/app
From: MarK
Yesterday I spent 4 hours testing her "final, absolutely perfect versions". :-) Then I gave up and wrote this post... :-(
From: Michael Gibson
Hi MarK,
re:
> Do you think the script could also assemble the parts according to dimensions (regardless of the
> orientation in the model) and round the dimensions to integers as I describe in the attached image?
It would help me understand better if you could make an example file with a small number of parts set up as you describe and an example of the desired output from that.
- Michael
From: MarK
Sending... Thank you very much. Marek
Attachments:
test.3dm
test.csv
Show messages:
1-17
18-37
38-41