sketchselector macro - review and feedback?

Need help, or want to share a macro? Post here!
db2000
Posts: 3
Joined: Thu May 21, 2020 3:26 am

sketchselector macro - review and feedback?

Postby db2000 » Thu May 21, 2020 6:36 am

I've attached a first macro for thoughts/feedback. If it gets the greenlight I'll run through the steps on the FreeCAD-macros github page.

What does this macro do?

The idea for this macro is to select connected (straight or arc) lines in the sketcher. Select one of the lines and the macro will select lines connected to that line.

How do you use it?

If you execute the macro with no sketch lines selected an options dialogue will come up. You can chose if the lines selected will be normal lines, construction lines or both normal and construction lines.

You also have the option of choosing if the lines selected are lines which might have connectivity error (eg there is a connection to one end and not the other or multiple normal lines). Generally if you are looking for errors to be highlighted then the line type selection would be normal.

The macro will save the parameters when you click ok so you can see them in tools->edit parameters under macro/sketchselector and you don't need to set it up each time and you can set up a hotkey if you would like.

With the options selected - click one sketch line, execute the macro and the connected sketch lines will be selected according to your preferences.

Thanks for taking a look.
Attachments
SketchSelector.FCMacro
(10.58 KiB) Downloaded 6 times
chrisb
Posts: 25204
Joined: Tue Mar 17, 2015 9:14 am

Re: sketchselector macro - review and feedback?

Postby chrisb » Thu May 21, 2020 7:40 am

Doesn't work on this one:
Snip macro screenshot-6f44c5.png
Snip macro screenshot-6f44c5.png (9.32 KiB) Viewed 188 times
I got the configuration dialog only once and had left everything at the defaults. Even after restarting I don't get the dialog.
chrisb
Posts: 25204
Joined: Tue Mar 17, 2015 9:14 am

Re: sketchselector macro - review and feedback?

Postby chrisb » Thu May 21, 2020 8:00 am

I forgot: In the Path workbench is a similar function (on edges of a solid) "Complete loop selection", you may have a look at it.
mario52
Posts: 2992
Joined: Wed May 16, 2012 2:13 pm

Re: sketchselector macro - review and feedback?

Postby mario52 » Thu May 21, 2020 9:05 am

hi

good macro but as chrisb the Image and Image not work

if finished for the wiki in place utility below Macro Shake Sketch

and create the icon for the toolbar and use the macro

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Dialog creation. My macros on Gist.github.
db2000
Posts: 3
Joined: Thu May 21, 2020 3:26 am

Re: sketchselector macro - review and feedback?

Postby db2000 » Thu May 21, 2020 9:50 am

Thanks - point on a line should be pretty easy to address, i'll make an update.
I'll take a look at the tangent one, not sure yet on that.

I'm not sure why the dialog didn't come up - if your editing a sketch, no lines are selected and the macro is executed it should show the options dialog, hmmmm.

Thanks to you both for the feedback.

DB.
db2000
Posts: 3
Joined: Thu May 21, 2020 3:26 am

Re: sketchselector macro - review and feedback?

Postby db2000 » Thu May 21, 2020 10:31 am

Ok, I think the tangent and the point on object are working now if want to try the updated version? I recreated the test example and it seemed to work.

The dialog not coming up is a bit of a mystery though.
sketchselectortest.JPG
sketchselectortest.JPG (56.54 KiB) Viewed 148 times
Attachments
SketchSelector.FCMacro
(10.73 KiB) Downloaded 2 times
mario52
Posts: 2992
Joined: Wed May 16, 2012 2:13 pm

Re: sketchselector macro - review and feedback?

Postby mario52 » Thu May 21, 2020 12:16 pm

hi

ok

the window is displayed if not object are selected, good

not forgote the icon

thanks

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Dialog creation. My macros on Gist.github.
chrisb
Posts: 25204
Joined: Tue Mar 17, 2015 9:14 am

Re: sketchselector macro - review and feedback?

Postby chrisb » Thu May 21, 2020 12:50 pm

Will test later. I probably had selected nothing in the first, and something in the subsequent tests. I find it quite natural to have something selected before invoking the macro.