Use FreeCAD as a STEP File Viewer


MacOS Ventura 13.5.2

Install FreeCAD.
Start FreeCAD with logging and exit.
Look in the log for the location of user.cfg
Log: UserConfigPath = /Users/ken/Library/Preferences/FreeCAD/

I didn’t have ~/.FreeCAD
so I mkdir ~/.FreeCAD

Then touch ~/.FreeCAD/test.log

Then in Terminal run:
/Applications/FreeCAD.app/Contents/MacOS/FreeCAD --log-file ~/.FreeCAD/test.log

look in the log to find user.cfg
in user.cfg, in Preferences

<FCParamGroup Name="Preferences">  
    <FCParamGroup Name="General">
    
    <FCText Name="AutoloadModule">SurfaceWorkbench</FCText>

Preferences > General > Start up: select Surface
set AutoloadModule to SurfaceWorkbench

/Applications/FreeCAD.app/Contents/MacOS/FreeCAD --user-cfg ~/.FreeCAD/step.cfg --log-file ~/.FreeCAD/test.log ~/Desktop/292303-4.step

Create automator to open file with FreeCAD –user-cfg step.cfg

Automator Application with file argument


Note that using \ to escape spaces on the bash command line produces a Traceback.
Quoting the path also produces a Traceback.
Quoting with \ escapes also produces a Traceback.
I finally gave up trying to pass a path with spaces and created a temporary file.


Automator:

for f in "$@"
do
  tempfile=$(mktemp -u).step
  cp "$f" $tempfile
  /Applications/FreeCAD.app/Contents/MacOS/FreeCAD --log-file ~/.FreeCAD/automater.log --user-cfg step.cfg "$tempfile"
  rm "$tempfile"
done

Windows 10

I’ll document this next time I’m using Windows.