Hi @mathieu1 ,
There is any possibility of importing a gCode in ShapeDiver?
Thanks
G-code are simply text files, which means you have two options:
- If your g-code file has a standard text file extension supported by the Import Text component, you can use it to import your file.
- If your g-code file has another extension (.g, .gcode or something else), you can import it as a memory stream using the Import Stream component.
Below is a small definition with both options (option 2 requires a small script to convert the memory stream into text).
ImportGcode.gh (9.6 KB)
Note that you can export gcode using the export components using standard text extensions as well as .g and .gcode.
Hi @mathieu1 ,
I’ve tried both of them before asking here but without result. If you look at the attached picture you’ll see the normal Read file (not supported by ShapeDiver) uploaded the gcode file which has 182371 rows while the length of ImportTxt is 1. I didn’t attach a Panel to ImportTxt because I’ve waited a long time to see the gcode but without a result so I forced Rhino to close
The script from ImportScript generates the attached messages. I’m using Rhino 7 - probably this is the problem!
ImportGcode.html (1.9 KB)
Could you please attach the exampe gcode file you are trying to import.
I modified the extension from .gcode to .txt because It is forbidden here to attach .gcode files
GS_Bottom_5mm_Size39_5_Polyflex_MVS5_0.4n_0.3mm_FLEX_COREONE_53m.txt (5.0 MB)
There were two issues:
- My script was using the Rhino 8 C# component, but you seem to be using Rhino 7. I adapted it for this version.
- The Import Text and Import Stream component with the script give you one block of text, not a list of fragments per row. You can simply split this to get the same result.
See the new version of the file here.
ImportGcode.gh (10.6 KB)
Thank you! I’ll try it!
(I told you I’m using Rhino 7)
Hi @mathieu1 ,
The new version works well - thank you!
I’ve tried to upload the definition (without ‘read file’ component) to Shape Diver and the answer is 'We have to check your model manually and it will be ready soon. Check it in pending models." and ‘script checking in progress’
What does this mean?
Thanks!
This happens when you include script nodes in your definitions. The script is now be validated, you should be able to finish setting up your model.
Ok, thanks!
În vin., 11 apr. 2025 la 09:40 Mathieu Huard via McNeel Forum <notifications@mcneel.discoursemail.com> a scris: