Jump to content
Ultimaker Community of 3D Printing Experts
geosfi

use cura from windows cmd

Recommended Posts

Hi im George this is my first post here. I use cura with all my printers and now i have a msc thesis assignment and i want to control cura through windows terminal. I can open a stl file, i used cura -s and sliced it. Finally i want to use cura -r in order to open the print interface and print the object. The problem is that i get

AttributeError module object has no attibute startPrintInterface

and it gives me errors in some lines in the cura.py and runpy.py files. Do you know how i can make it works?

Thanks!

 

Share this post


Link to post
Share on other sites

Ok. I can send the command from windows cmd to slice the file. I have done it and create a gcode file. And then send the command to open cura the gcode file. This is almost there i believe is good enough. It would be nicer if i could get the print info (estimated time, weight of object and cost) do they stored somewher? I cant find them in gcode file.somewhere else maybe where i can have access? I want to find them and send them through a web service.

Share this post


Link to post
Share on other sites

Hi,

While running CuraEngine -s "C:\path\to\STL File\" I'm getting the below output:-

This program is free software: you can redistribute it and/or modify

it under the terms of the GNU Affero General Public License as published by

the Free Software Foundation, either version 3 of the License, or

(at your option) any later version.

This program is distributed in the hope that it will be useful,

but WITHOUT ANY WARRANTY; without even the implied warranty of

MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License

along with this program. If not, see .

Default config 'default.cfg' not used

M107

G1 F2700 E-4.50000

G0 F9000 X0.00 Y0.00 Z5.00

M104 S0 ;extruder heater off

M140 S0 ;heated bed heater off (if you have it)

G91 ;relative positioning

G1 E-1 F300 ;retract the filament a bit before lifting the

nozzle, to release some of the pressure

G1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more

G28 X0 Y0 ;move X/Y to min endstops, so the head is out of

the way

M84 ;steppers off

G90 ;absolute positioning

Please let me know how can I get a correct gcode file

Thanks & Regards,

Debakanta

Share this post


Link to post
Share on other sites

Hi geosfi,

Can you please let us know what exact command you have given to produce a gcode file from CMD prompt.

I don't have .ini file. I just use to give CuraEngine -s "C:\path\to\STL File\"

Though it is producing .gcode file the contents are not the expected stuffs.

I get the out put as below:

This program is free software: you can redistribute it and/or modify

it under the terms of the GNU Affero General Public License as published by

the Free Software Foundation, either version 3 of the License, or

(at your option) any later version.

This program is distributed in the hope that it will be useful,

but WITHOUT ANY WARRANTY; without even the implied warranty of

MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License

along with this program. If not, see .

Default config 'default.cfg' not used

M107

G1 F2700 E-4.50000

G0 F9000 X0.00 Y0.00 Z5.00

M104 S0 ;extruder heater off

M140 S0 ;heated bed heater off (if you have it)

G91 ;relative positioning

G1 E-1 F300 ;retract the filament a bit before lifting the

nozzle, to release some of the pressure

G1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more

G28 X0 Y0 ;move X/Y to min endstops, so the head is out of

the way

M84 ;steppers off

G90 ;absolute positioning

Please let me know how can I get a correct gcode file.

Thanks & Regards,

Debakanta

Share this post


Link to post
Share on other sites

Hi,

Tried passing all kind of arguments with all possible ways but every time gcode is produced with unexpected contents. They seems to be of around 15 lines of info without gcode complete contents.

Without -o C:\Path\to\fileName.gcode option the output is coming as below:

While running the CuraEngine -s "C:\Path\to\file.stl" I'm getting the output as below:

This program is free software: you can redistribute it and/or modify

it under the terms of the GNU Affero General Public License as published by

the Free Software Foundation, either version 3 of the License, or

(at your option) any later version.

This program is distributed in the hope that it will be useful,

but WITHOUT ANY WARRANTY; without even the implied warranty of

MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License

along with this program. If not, see .

Default config 'default.cfg' not used

M107

G1 F2700 E-4.50000

G0 F9000 X0.00 Y0.00 Z5.00

M104 S0 ;extruder heater off

M140 S0 ;heated bed heater off (if you have it)

G91 ;relative positioning

G1 E-1 F300 ;retract the filament a bit before lifting the

nozzle, to release some of the pressure

G1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more

G28 X0 Y0 ;move X/Y to min endstops, so the head is out of

the way

M84 ;steppers off

G90 ;absolute positioning

Kindly let us know the exact command.

I do not have .ini file.

Please let me know how can I get a correct gcode file

Thanks & Regards,

Debakanta

Share this post


Link to post
Share on other sites

Hi,

It is generating the .gcode file but contents are not expected.

We get the below error message:

-------------------------------------------------------------------------------------

Default config 'default.cfg' not used

Config(part1.ini): Line 1: No key value pair found

Failed to read config 'part1.ini'

Failed to open part1.gcode for output.

--------------------------------------------------------------------------------------

It is generating well from UI.

Do we need any licence or rights to run it from command prompt?

We do not get .ini file any where.

If no licence is required then can you please share the exact command using which we can generate a .gcode file

Please guide me what ideally I should be doing.

Thanks & Regards,

Debakanta

Share this post


Link to post
Share on other sites

Well, I don't know what command line you are using that results in your 'Config(part1.ini): Line 1:No key value pair found" error. I don't know what part1.ini file is from your set up.

I also didn't know how to do any of this until just over a few hours ago when I saw your post and decided to see if I could figure it out for myself. So I'm no expert. But I did get it working to a degree.

In addition, I'm using Cura 15.04.4 which is newer than yours and so yours may contain bugs that are hampering your progress.

All that said, from following the -'help' switch output from CuraEngine, the most basic slicing command for .stl in and .gcode out would be:

 

CuraEngine.exe -o c:\path\to\output.gcode c:\path\to\input.stl

 

If you wish to supply an .ini file for your printer's setting, you need to: File / Save Profile in the Cura GUI and then use that .ini file on the command line in Cura:

 

CuraEngine.exe -c c:\path\to\profile.ini -o c:\path\to\output.gcode c:\path\to\input.stl

 

However, I have been unable to get the CuraEngine to read the .ini file. It always returns this error:

Line zd: No key value pair found

Not sure if your older version of Cura will work on reading the .ini or not.

Share this post


Link to post
Share on other sites

Hi,

I'm able to generate .gcode file using below command

CuraEngine -c "C:\path\to\preferences.ini" -o "C:\path\to\test1.gcode" "C:\path\to\\snowManAll.stl"

It is failing to load if I pass .obj or .amf file instead of .stl files

Need your guidance in this concern.

Thanks & Regards,

Debakanta

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

Welcome to the Ultimaker Community of 3D printing experts. Visit the following links to read more about our Terms of Use or our Privacy Policy. Thank you!