Feature: offset tool in sketcher

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Piero69
Posts: 151
Joined: Thu Jul 04, 2019 1:22 pm
Location: Parma - Italy

Re: Feature: offset tool in sketcher

Postby Piero69 » Mon Feb 01, 2021 9:15 am

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
Posts: 33587
Joined: Tue Mar 17, 2015 9:14 am

Re: Feature: offset tool in sketcher

Postby chrisb » Mon Feb 01, 2021 10:00 am

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: 13
Joined: Wed Jan 20, 2021 6:58 pm

Re: Feature: offset tool in sketcher

Postby skopjanecot » Mon Feb 01, 2021 2:05 pm

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
Posts: 33587
Joined: Tue Mar 17, 2015 9:14 am

Re: Feature: offset tool in sketcher

Postby chrisb » Tue Feb 02, 2021 10:52 am

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
Posts: 33587
Joined: Tue Mar 17, 2015 9:14 am

Re: Feature: offset tool in sketcher

Postby chrisb » 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.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
skopjanecot
Posts: 13
Joined: Wed Jan 20, 2021 6:58 pm

Re: Feature: offset tool in sketcher

Postby skopjanecot » Tue Feb 02, 2021 6:38 pm

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: 270
Joined: Fri Jan 17, 2020 1:32 pm

Re: Feature: offset tool in sketcher

Postby edi » Wed Feb 03, 2021 8:50 am

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
Posts: 33587
Joined: Tue Mar 17, 2015 9:14 am

Re: Feature: offset tool in sketcher

Postby chrisb » Wed Feb 03, 2021 10:20 am

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: 270
Joined: Fri Jan 17, 2020 1:32 pm

Re: Feature: offset tool in sketcher

Postby edi » Tue Feb 09, 2021 1:56 pm

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

Re: Feature: offset tool in sketcher

Postby chrisb » Tue Feb 09, 2021 3:00 pm

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.