Feature: offset tool in sketcher

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
Piero69
Posts: 471
Joined: Thu Jul 04, 2019 1:22 pm
Location: Parma - Italy

Re: Feature: offset tool in sketcher

Post by Piero69 »

I too get this error ...

some help?
skopjanecot wrote: Sun Jan 31, 2021 10:25 pm I'm getting the following error when trying to use the macro:

Code: Select all

23:23:02  <class 'IndentationError'>: ('expected an indented block', ('/home/___________/.FreeCAD/Macro/SketcherOffset.FCMacro', 28, 1, '""" \n  read selected items and show the offset distance\n""" \n'))
Would just love to have this one work for me. Constraining every little corner for tolerance just destroys my little soul :)
chrisb
Veteran
Posts: 53785
Joined: Tue Mar 17, 2015 9:14 am

Re: Feature: offset tool in sketcher

Post by chrisb »

Please attach a preferably simple sketch, so edi can have a look at it.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
skopjanecot
Posts: 17
Joined: Wed Jan 20, 2021 6:58 pm

Re: Feature: offset tool in sketcher

Post by skopjanecot »

chrisb wrote: Mon Feb 01, 2021 10:00 am Please attach a preferably simple sketch, so edi can have a look at it.
I get this error when trying to offset a simple rectangle or a line. Not sure a sketch is necessary.
chrisb
Veteran
Posts: 53785
Joined: Tue Mar 17, 2015 9:14 am

Re: Feature: offset tool in sketcher

Post by chrisb »

I can confirm:
- Select a line
- call the macro
-> The error shows before even the Popups shows up asking for the offset.

I guess this error is a result of Abdullah's recent Sketcher changes
edi wrote: ping
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 53785
Joined: Tue Mar 17, 2015 9:14 am

Re: Feature: offset tool in sketcher

Post by chrisb »

chrisb wrote: Tue Feb 02, 2021 10:52 am I guess this error is a result of Abdullah's recent Sketcher changes
I am unsure about this: I checked an older version of the macro, when it still was called OffsetInSketcher.py and that works.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
skopjanecot
Posts: 17
Joined: Wed Jan 20, 2021 6:58 pm

Re: Feature: offset tool in sketcher

Post by skopjanecot »

chrisb wrote: Tue Feb 02, 2021 10:56 am
chrisb wrote: Tue Feb 02, 2021 10:52 am I guess this error is a result of Abdullah's recent Sketcher changes
I am unsure about this: I checked an older version of the macro, when it still was called OffsetInSketcher.py and that works.
Just checked the older version as well and it works fine. I will use that one until things are figured out. Unfortunately I cannot help more then test the updates :)
edi
Posts: 481
Joined: Fri Jan 17, 2020 1:32 pm

Re: Feature: offset tool in sketcher

Post by edi »

Thank you everybody for your posts in the last days. I have fixed the bug and will try to initiate updating the source in master-github in the next days.
Please use meanwhile the source published in this thread.

What happened ?

The original macro includes many "green" comments (# comment). But macros published in the master must have only "white" comments (''' comment'''). I do not know why.
When changing the comments from one kind to the other, python-syntax errors (indentation errors) occured. And nobody tested.
chrisb
Veteran
Posts: 53785
Joined: Tue Mar 17, 2015 9:14 am

Re: Feature: offset tool in sketcher

Post by chrisb »

edi wrote: Wed Feb 03, 2021 8:50 am But macros published in the master must have only "white" comments (''' comment'''). I do not know why.
Other macros installed via AddonManager have "# ... " comments. You may ask in the Python subforum about how to use them.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
edi
Posts: 481
Joined: Fri Jan 17, 2020 1:32 pm

Re: Feature: offset tool in sketcher

Post by edi »

Source in master-github
https://github.com/FreeCAD/FreeCAD-macr ... et.FCMacro
has been updated. Hope it's now without issues.
chrisb
Veteran
Posts: 53785
Joined: Tue Mar 17, 2015 9:14 am

Re: Feature: offset tool in sketcher

Post by chrisb »

Works again, thanks. It seems that at least some of the redundancies could be avoided. I will have a closer look and report back.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply