SVG CLI error: object of type 'LaserOperation' has no len()
See original GitHub issueTrying to use the command line options to parse and execute a job:
meerk40t -zaS 100 ~/circle.svg
I get the following error:
Traceback (most recent call last):
File "/usr/local/bin/meerk40t", line 8, in <module>
sys.exit(run())
File "/usr/local/lib/python3.9/site-packages/meerk40t/main.py", line 322, in run
device("plan validate\n")
File "/usr/local/lib/python3.9/site-packages/meerk40t/kernel.py", line 136, in __call__
return self._kernel.console(data)
File "/usr/local/lib/python3.9/site-packages/meerk40t/kernel.py", line 2231, in console
self._console_parse(command, channel=self._console_channel)
File "/usr/local/lib/python3.9/site-packages/meerk40t/kernel.py", line 2316, in _console_parse
data, remainder, input_type = command_funct(
File "/usr/local/lib/python3.9/site-packages/meerk40t/kernel.py", line 1173, in inner
returned = func(command=command, channel=channel, **ik, **kwargs)
File "/usr/local/lib/python3.9/site-packages/meerk40t/core/cutplanner.py", line 296, in plan
self.execute()
File "/usr/local/lib/python3.9/site-packages/meerk40t/core/cutplanner.py", line 400, in execute
cmd()
File "/usr/local/lib/python3.9/site-packages/meerk40t/core/cutplanner.py", line 469, in strip_rasters
if len(op) == 1 and isinstance(op[0], SVGImage):
TypeError: object of type 'LaserOperation' has no len()
Here’s the SVG file:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="60mm"
height="60mm"
viewBox="0 0 60 60"
version="1.1"
id="svg8"
inkscape:version="1.0.2 (e86c8708, 2021-01-15)"
sodipodi:docname="circle.svg">
<defs
id="defs2">
<rect
x="71.06275"
y="119.13209"
width="32.594937"
height="12.257925"
id="rect855" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.94972573"
inkscape:cx="134.40268"
inkscape:cy="43.665962"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
inkscape:document-rotation="0"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1252"
inkscape:window-height="943"
inkscape:window-x="0"
inkscape:window-y="25"
inkscape:window-maximized="0" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-57.690468,-82.636902)">
<circle
style="fill:none;fill-rule:evenodd;stroke-width:0.264583;stroke:none;stroke-opacity:1"
id="path10"
cx="87.690468"
cy="112.6369"
r="30" />
<text
xml:space="preserve"
id="text853"
style="font-style:normal;font-weight:normal;font-size:10.58329999999999949px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect855);fill:#0000ff;fill-opacity:1;stroke:none;text-align:center"
x="13.492674"
y="0"><tspan
x="73.86251"
y="128.78828"><tspan
style="text-align:center;text-anchor:middle;fill:#0000ff;fill-opacity:1">TEST</tspan></tspan></text>
</g>
</svg>
Issue Analytics
- State:
- Created 2 years ago
- Comments:32 (17 by maintainers)
Top Results From Across the Web
Python - TypeError: object of type '...' has no len()
You're calling len on an instance of CoordinateRow , but that class doesn't define a __len__ function. – Aran-Fey. Nov 23, 2014 at...
Read more >How to Fix Type Error: Object of Type 'int' has no len() - YouTube
Are you trying to understand what TypeError: object of type 'int' has no len() means and how you can fix it? Here in...
Read more >TypeError: object of type 'type' has no len() - Yawin Tutor
The python error TypeError: object of type 'type' has no len() occurs while attempting to find the length of an object that returns...
Read more >Python TypeError: object of type 'NoneType' has no len()
The “TypeError: object of type 'NoneType' has no len() ” error is caused when you try to use the len() method on an...
Read more >How to fix: TypeError: object of type 'NoneType' has no len()
Eg you could use a list comprehension and "if is not None". In pandas there is "dropna". Maybe you want to show your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I figured it out! I just ended up deleting the actual operations, since deleting the elements didn’t really work.
Here’s the final command line:
meerk40t -z -e “timer 1 1 home” -e “inkscape locate input 304705.svg text2path load” -e “element* translate 0 0” -e “element* translate 3in 3in” -e “timer 1 2 operation2,3 delete” -e “timer 1 3 elements* engrave -s 110” -e “timer 1 10 plan copy preprocess validate list append home blob list spool” -e “timer 1 50 quit”
The menus do exist in Mac OS X. They conform to Mac OS standards instead though; and appear in the regular menu bar at the top of the screen; next to the Apple menu, and MeerK40t menu. They are only active when the Jobs window is in front.
The Camera window will also override menus to show those are specific to the camera window as well.