Macro Unroll Ruled Surface error

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
jfc4120
Posts: 448
Joined: Sat Jul 02, 2022 11:16 pm

Macro Unroll Ruled Surface error

Post by jfc4120 »

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.29177 (Git)
Build type: Release
Branch: releases/FreeCAD-0-20
Hash: 68e337670e227889217652ddac593c93b5e8dc94
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.2
Locale: English/United States (en_US)
Installed mods: 
  * Help 1.0.3
I am new to freecad, and trying to use the macro Unroll Ruled Surface.

https://wiki.freecadweb.org/Macro_Unroll_Ruled_Surface

I keep getting the error:
<class 'TabError'>: ('inconsistent use of tabs and spaces in indentation', ('C:/Users/Owner/AppData/Roaming/FreeCAD/Macro/Unroll_Ruled_Surface.FCMacro', 96, 25, '\tif faces.__len__() > 1:\n'))
File is attached, could someone guide me on how to fix the macro so it works. I have never programmed in python, but have in other languages.
Attachments
unroll1.FCStd
(15.87 KiB) Downloaded 9 times
User avatar
onekk
Veteran
Posts: 6205
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Macro Unroll Ruled Surface error

Post by onekk »

error report is clear there are mixed tabs and spaces in indentation.

So find lines with tabs instead of spaces (usually a good editor could show unprintable characters).

In python is better to use spaces, for consistency and as spaces are always the same tabs depends on some local config and could be different across machines.

Usually Python use 4 spaces per level of indentation.

Hope it helps

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
Post Reply