DXF to SVG using Inkscape CLI on Mac OS - svg

I'm trying to convert DXF files (from Fusion360) to plain SVG files using the Inkscape CLI. It works fine with one small annoyance: the Inkscape GUI promps me on how to read the dxf file (the settings in there are fine, all I do is click ok).
It's the same dialog you get when importing a dxf file through the Gui.
The command I'm running:
/Applications/Inkscape.app/Contents/Resources/bin/inkscape -z -l <absolutePath>/output.svg <absolutePath>/input.dxf
I've also tried this with no success with regard to the dialog popup:
/Applications/Inkscape.app/Contents/Resources/bin/inkscape -z -f <absolutePath>/input.dxf -l <absolutePath>/output.svg
-z means no GUI. Which works in terms of no Inkscape instance starting (XQuartz is starting though), but the pesky dialog can just assume ok and move on rather than checking with me for an ok click.
To be clear, the actual export is just fine. It's only the Gui dialog that's crashing my CLI-high :)
In short: any chance on flagging that dialog to go ahead without actual interaction from my part?
Specs:
MacOS 10.13.
Inkscape 0.91

Related

'hello world' PyInstaller .app doesn't open

This is a common problem, though the solutions seem diverse and none have helped me.
Like this question and this question, on mac, my PyInstaller .app fails to open when clicked on in Finder. However it does work when launched from the terminal ./helloWorldTest.app/Contents/MacOS/helloWorldTest. The .exe file does works when clicked on in Finder (which from my reading also seems common).
Unlike the apps in the linked questions, my app does not read or write any files: I have entirely gutted my actual app (which has the same problematic behaviour) to a simple hello world version:
# This is a trivial app with a loop to ensure it stays open long enough to actually see something happen before the script finishes.
print('hello world!')
i = 0
while i < 1000000:
print('hello world number: ', i)
i += 1
While >90% of the solutions to similar sounding problems all involve changing paths, that can't be the issue here as there is essentially nothing to this app. So, can anyone help me get this basic app working so I can build & debug from there?
Here is the PyInstaller command I use: pyinstaller helloWorldTest.py --onefile --icon=dipyIcon.icns -w --clean
Kinda surprising got given how seemingly prevalent this issue is. Anyway, for anyone searching/googling this in the future, hopefully this will help.
The issue is caused by the default version of something called Tcl that is used in your bundled app. The latest version for some reason doesn't work, so you need to manually set it to a slightly older version.
Note: This solution was found by manuelf23, I am only relaying it here. You can find the original thread here
To do this:
Right click your .app file (the one with the icon, you have given it one)
Click Show package contents (You're now in the hidden files that are bundled together. These files sit in a standard OSX structure, which is the same architecture as any app on a mac
Navigate to this file: ./Contents/Resources/tcl/init.tc [note, you do not use the --onefile flag otherwise you'll only have your icon in the Resources folder]
Open the init.tc file in any text editor and go to line 19
On line 19 you'll find this line (package require -exact Tcl 8.6.8) and replace it with package require -exact Tcl 8.5.9 - or put simply change the Tcl version to 8.5.9
Et VoilĂ , vous ĂȘtes au top- go back to your app and double click your icon
Just in case, here's the PyInstaller command I used:
pyinstaller myFileName.py -w --icon myIconName.icns
EDIT: forgot to link source of solution

Convert SVG to DXF in Inkscape CLI

I wonder how can we convert SVG to DXF in Inkscape CLI mode. IN GUI to export/save svg to dxf we can do it from file menu by doing Save As
i went through inkscape cli document : https://inkscape.org/doc/inkscape-man.html
here mostly export words is used , so i tried
inkscape --export-type=out.dxf in.svg
inkscape --export-filename=out.dxf in.svg
but no success giving me errpr
InkFileExportCmd::export: Unknown export type: out.dxf. Allowed values: [svg,png,ps,eps,pdf,emf,wmf,xaml].
however in GUI under FILE -> SAVE AS we can see a lot of file formats including DXF
You need to run the extension from the command line, using the available parameters. Find it in your Inkscape installation folder, inside the directory /share/inkscape/extensions.
So, in the most basic version:
python3 dxf_outlines.py --output="yourfile.dxf" "yourfile.svg"
You can also type
python3 dxf_outlines.py -h
to find out all about the options.
I tried using sample code:
// command:
C:\>F:\inkscape\bin\inkscape --export-filename=F:\aaa.dxf F:\valve.svg
Although there was no tracing back messages, but it succeeded:

Terminal doesn't open window on top Mac - Atom

I am currently using Atom to code in Python3 on my Mac and I have a package installed ("atom-python-run") which launches a terminal window with the command "python3 {path}" with 'path' being the current working directory with filename.py included. It opens just fine and runs perfectly, but the window doesn't open on top of my atom window but behind it instead. I have to click it every time to see the terminal window and it's really frustrating. I also hate using CMD+Tab to find it as well.
This is a bug in the package I'm using (I think) and I don't want to wait for them to fix it. Are there any methods in OS X to ALWAYS open Terminal on top of every other window? Or a third-party application? I can't find a solution to this problem anywhere online.
If you install the scripts package and use it, the output will be written to a window in the Atom application and will be shown at completion. Go to the Atom package page and search for the word script. You should get a hit on the "script" package. Install this package by just clicking on the install button and then open Atom and the python script you wish to run. Now in Atom go to the packages menu item and from that menu select "script". You'll be given several options, choose "run script" and your script should run showing the output in a window at the bottom of the Atom window.

Remove icon from pyinstaller when creating command line tool

I'm using windows and I've just created this command line tool. I'm trying to package it with pyinstaller and since its a command line tool, I don't want any icon on it including pyinstaller's default icon. I tried setting icon=none at the spec file side but still it created it with the icon. Any Idea how to solve it?
I know that this is really old post, but you can always remove icon by using the argument -i "NONE", for example
pyinstaller file.py -i "NONE"

How to create files and folder in Atom using the command line?

I was watching a speedy workflow tutorial about Atom text editor, and saw how the guy uses Linu commands like ls (to check the files in the directory), touch (to create files eg. style.css) and mkdir (to create folders). Now in my Atom editor I am able to open the command line using the following command.
CTRL + SHIFT + T
Now in my command line the default windows command line opens up, I am able to create folder using mkdir, but the commands touch and ls don't work, which makes me wonder weather Atom has its own command line?
See the SCREENSHOT to see how this guy is creating folders, files and using the ls command.
So my question is, how do I create files in Atom? How do I get the touch command to work?
It looks like the tutorial is using the Term2 package for opening a shell within the editor (http://code.tutsplus.com/courses/speedy-workflows-with-atom/lessons/term2). Since you seem to be able to open a terminal using the described screenshot, you seem to have the Term2 package installed - so far so good.
This package opens a standard command window within the editor. The tutorial seems to be using Linux or Mac OS X as the operating system. If you're running Windows, you will only have the Windows CMD interpreter available.
Windows does not natively support the touch command (but it has a mkdir command). There is a unxtools project that provides some of the common Gnu tools. If you install that, you should be able to run touch from the Windows command shell as well. More details can be found here.

Resources