Macro_Connect_And_Sweep

Need help, or want to share a macro? Post here!
ghioan
Posts: 2
Joined: Wed Apr 03, 2019 6:30 am

Macro_Connect_And_Sweep

Postby ghioan » Thu Apr 04, 2019 1:18 pm

Hi! I want to use Macro_Connect_And_Sweep in freecad 0.18 but it do not working, but in freecad 0.17 it working. Do you know a similar macro that working in freecad 0.18?

Mod Edit: OP is referring to Macro_Connect_And_Sweep
Last edited by Kunda1 on Tue Jun 18, 2019 8:27 am, edited 1 time in total.
Reason: added link to macro in question
mario52
Posts: 3309
Joined: Wed May 16, 2012 2:13 pm

Re: Macro_Connect_And_Sweep

Postby mario52 » Fri Apr 05, 2019 2:30 pm

hi

modify the line 79 adding parenthesis (compatible Python 3: print())

Code: Select all

print( "Path for the icons : " , path )
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting, Dialog creation. My macros on Gist.github.
ghioan
Posts: 2
Joined: Wed Apr 03, 2019 6:30 am

Re: Macro_Connect_And_Sweep

Postby ghioan » Sat Apr 06, 2019 7:48 am

thank you!
michael.h
Posts: 2
Joined: Tue Jun 18, 2019 7:28 am

Re: Macro_Connect_And_Sweep

Postby michael.h » Tue Jun 18, 2019 7:36 am

Hi Marco!

The modified version on GitHub doesn't work for me on 0.18 either.
The Freecad.log says

Code: Select all

Err: Select twoo objects (1 object(s) selected)
although I have selected the two Endpoints (which works in 0.17).

Any ideas?

Michael
User avatar
Kunda1
Posts: 9220
Joined: Thu Jan 05, 2017 9:03 pm

Re: Macro_Connect_And_Sweep

Postby Kunda1 » Tue Jun 18, 2019 8:32 am

mario52 wrote:
Fri Apr 05, 2019 2:30 pm
Offtopic: the macro itself isn't on the wiki but in a gist
https://gist.githubusercontent.com/mari ... ep.FCMacro

There are some typos in it. Where do i submit them? Is it better for these type of macros to be available in the FreeCAD-addons repo ?
Alone you go faster. Together we go farther
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
mario52
Posts: 3309
Joined: Wed May 16, 2012 2:13 pm

Re: Macro_Connect_And_Sweep

Postby mario52 » Tue Jun 18, 2019 11:34 am

Hi michael.h

thanks for apreciate my litle macro,

the macro work with 0.16, 0.17, 0.18, 0.18 pre, 0.19 (16993Git), 0.19 (16687Git)
the only little problem "Recompute" with Lune , i have corrected it now (ver 0.6)
michael.h wrote:
Tue Jun 18, 2019 7:36 am
Hi Marco!

Code: Select all

Err: Select twoo objects (1 object(s) selected)
for this error (1 object(s) selected), you must select 2 points or 2 objects or one point and one object

tray this (2 objects) and please report if you have again one error

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting, Dialog creation. My macros on Gist.github.
michael.h
Posts: 2
Joined: Tue Jun 18, 2019 7:28 am

Re: Macro_Connect_And_Sweep

Postby michael.h » Wed Jun 19, 2019 10:49 am

Hi Mario,
mario52 wrote:
Tue Jun 18, 2019 11:34 am
for this error (1 object(s) selected), you must select 2 points or 2 objects or one point and one object

tray this (2 objects) and please report if you have again one error
I still got the same error. Please see the attached video I made showing the problem.
Maybe I'm doing something wrong, but it works like charm with 0.17 but not with 0.18 16110 (Git).

https://drive.google.com/open?id=1OoHp2 ... 8uu4tG8hic
mario52
Posts: 3309
Joined: Wed May 16, 2012 2:13 pm

Re: Macro_Connect_And_Sweep

Postby mario52 » Thu Jun 20, 2019 9:18 am

Hi

thanks for report

i use the code

Code: Select all

import FreeCADGui, Draft
sel = FreeCADGui.Selection.getSelection() 
print(len(sel))
two points selected in the same line (object) :

< and 0.17 give 2

0.18 and > give 1

change in FC or bug ??

pending my correction you can create a point at the begin and end line and select the two points

i work to the correction
thanks

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting, Dialog creation. My macros on Gist.github.
mario52
Posts: 3309
Joined: Wed May 16, 2012 2:13 pm

Re: Macro_Connect_And_Sweep

Postby mario52 » Wed Jun 26, 2019 5:55 pm

hi

i have upgrade my macro (available with AddonManager), i separate the mode:

1: Object to Object
2: Object to SubObject
3: SubObject to SubObject (by default)

and if one object wire line arc is selected the forme is created in the direction of the object

example selected
line = point begin to point end (or edge) (as point to point)
arc = angle begin to angle end (as point to point)

example animated on the wiki

now the macro is adapted for the body (in case if the body is not in 0,0,0 points)

Image

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting, Dialog creation. My macros on Gist.github.