Fix Macro indentation? Macro_Unroll_Ruled_Surface

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
edwilliams16
Veteran
Posts: 3191
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Fix Macro indentation? Macro_Unroll_Ruled_Surface

Post by edwilliams16 »

I installed https://wiki.freecadweb.org/Macro_Unroll_Ruled_Surface but the indentation appears to have been trashed somehow. Anyone know how to automate fixing this? I don't want to go through 690 lines by hand, just to see if it works.

VSCode "indent using spaces" didn't work.
Last edited by edwilliams16 on Sun Jul 24, 2022 11:57 pm, edited 2 times in total.
heda
Veteran
Posts: 1348
Joined: Sat Dec 12, 2015 5:49 pm

Re: Fix Macro indentation?

Post by heda »

i cleaned that script up, the example worked out of the box...
other things brought it to an immediate halt, so looking into if that is somewhat fixable
anyhow, will put it out there (wiki) in a not too distant future.

there are 2 versions out there, one on the wiki and one on git, there is no difference in actual code, mainly removal of all those comments and attempts to fix the indention without being successful.

for me the aom took the wiki, not git, so maybe just wipe that listing on git?
TheMarkster
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

Re: Fix Macro indentation?

Post by TheMarkster »

You can probably use Editor Assistant macro to replace \t with (4 spaces).
edwilliams16
Veteran
Posts: 3191
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: Fix Macro indentation?

Post by edwilliams16 »

TheMarkster wrote: Fri Jul 22, 2022 10:22 pm You can probably use Editor Assistant macro to replace \t with (4 spaces).
That I could do many ways. The problem was the indentation levels varied from function to function.
jfc4120
Posts: 448
Joined: Sat Jul 02, 2022 11:16 pm

Re: Fix Macro indentation?

Post by jfc4120 »

If someone gets it working, please post code here.
User avatar
mfro
Posts: 666
Joined: Sat Sep 23, 2017 8:15 am

Re: Fix Macro indentation?

Post by mfro »

That said macro can be installed conveniently from the addon manager.

[edit: just tried - it appears indentation is messed up there as well]
Cheers,
Markus
edwilliams16
Veteran
Posts: 3191
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: Fix Macro indentation?

Post by edwilliams16 »

mfro wrote: Sat Jul 23, 2022 5:32 am That said macro can be installed conveniently from the addon manager.

[edit: just tried - it appears indentation is messed up there as well]
I found it three places. They are all messed up.
User avatar
onekk
Veteran
Posts: 6222
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Fix Macro indentation?

Post by onekk »

It is not guaranteed but some jurric era editor like Emacs should help to point out at least were the problem is.

Setting it up for python is not flawless, but correctly configured it will show problematic lines.

or using dome puthon linter like pyflake, pylint or similar could help to scan the source file and find problematic lines.

But it is not an easy task as it is not easy to guess the code flow for an "artificial deficiency" :D

Hope it helps.

Regards

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/
User avatar
Roy_043
Veteran
Posts: 8577
Joined: Thu Dec 27, 2018 12:28 pm

Re: Fix Macro indentation?

Post by Roy_043 »

Note that the macro relies on the Drawing Workbench which is scheduled for removal.
User avatar
mfro
Posts: 666
Joined: Sat Sep 23, 2017 8:15 am

Re: Fix Macro indentation?

Post by mfro »

Roy_043 wrote: Sat Jul 23, 2022 11:11 am Note that the macro relies on the Drawing Workbench which is scheduled for removal.
It imports Drawing, but doesn't seem to use it?
Cheers,
Markus
Post Reply