Fix Macro indentation? Macro_Unroll_Ruled_Surface
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Veteran
- Posts: 3191
- Joined: Thu Sep 24, 2020 10:31 pm
- Location: Hawaii
- Contact:
Fix Macro indentation? Macro_Unroll_Ruled_Surface
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.
VSCode "indent using spaces" didn't work.
Last edited by edwilliams16 on Sun Jul 24, 2022 11:57 pm, edited 2 times in total.
Re: Fix Macro indentation?
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?
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?
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: Fix Macro indentation?
You can probably use Editor Assistant macro to replace \t with (4 spaces).
-
- Veteran
- Posts: 3191
- Joined: Thu Sep 24, 2020 10:31 pm
- Location: Hawaii
- Contact:
Re: Fix Macro indentation?
That I could do many ways. The problem was the indentation levels varied from function to function.TheMarkster wrote: ↑Fri Jul 22, 2022 10:22 pm You can probably use Editor Assistant macro to replace \t with (4 spaces).
Re: Fix Macro indentation?
If someone gets it working, please post code here.
Re: Fix Macro indentation?
That said macro can be installed conveniently from the addon manager.
[edit: just tried - it appears indentation is messed up there as well]
[edit: just tried - it appears indentation is messed up there as well]
Cheers,
Markus
Markus
-
- Veteran
- Posts: 3191
- Joined: Thu Sep 24, 2020 10:31 pm
- Location: Hawaii
- Contact:
Re: Fix Macro indentation?
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"
Hope it helps.
Regards
Carlo D.
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"
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/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
Re: Fix Macro indentation?
Note that the macro relies on the Drawing Workbench which is scheduled for removal.