I have an STL file and I would like to know how many grams would this print consume. Is there a software so I can get it or an online link that can say me that?
You can not tell this by looking at the STL file alone, because how much material will be used depends on the print settings (obviously, printing at 100% infill will consume much more material than 10%).
The best way to check the material usage is to load the model into a slicer and slice it using your preferred settings. Most slicers will report the projected material usage, often in grams but sometimes in meters of filament (but the two figures are easily converted between each other if you know the density and diameter of your material).
Here is an example in the Cura slicer:
Simplify3D (after you click "prepare to print!") also shows you the projected print time and material usage and even the cost of the material (if you have previously entered the material cost per kilogram):
Slic3r will calculate the weight after you have exported the G-Code.
Normally, you'll only see the "Info" box. But after saving as G-Code, there's a "Sliced Info" which mentions the weight according to the settings you made (filament type and infill).
That's how it looks like:
Some slicing programs will give this information. Here is the first comment at the end of the print, which gives volume and length of material used, from gcode generated by Slic3r:
; filament used = 388.6mm (0.9cm3)
According to ToyBuilder Labs, ABS is 1.04 g/cm3, so 0.9 * 1.04 = 0.936, or just under one gram.
In the G-code file produced by the slicer, search for "filament" or "M30" - it's right after the M30. You might need to use the verbose G-code option.
This is a link I found that analyzes your G-code ( filament usage, time, etc.): gCodeViewer
From the description (emphasis is mine):
- Analyze GCode
- Print time, amount of plastic used, layer height, etc. for whole file and for single layer
Here is a screenshot: