New macro " Wise2", targeting effeciency and sketch + feature

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
obelisk79
Veteran
Posts: 1061
Joined: Thu Sep 24, 2020 9:01 pm

Re: New macro " Wise1", targeting effeciency and sketch + feature

Post by obelisk79 »

Add a small 3 to 4 icon toolbar with menu buttons to organize like-functions. Would be a cleaner way to manage screen real-estate that way. Or dockable panels such as what manipulator wb does.
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: New macro " Wise1", targeting effeciency and sketch + feature

Post by chrisb »

obelisk79 wrote: Wed Aug 24, 2022 5:54 pm Add a small 3 to 4 icon toolbar with menu buttons to organize like-functions. Would be a cleaner way to manage screen real-estate that way. Or dockable panels such as what manipulator wb does.
And finally it may end looking just like Sketcher itself :lol: .
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
freedman
Veteran
Posts: 3441
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: New macro " Wise1", targeting effeciency and sketch + feature

Post by freedman »

what's the purpose of having sketcher commands in the widget if using the regular commands works the same? (circle, rectangle, etc.)
Another reason for redundancies, with two 24" monitors it"s about 2 feet from model to the preferences panel, 10" from sketching up to the toolbar, I end up like one of those bobblehead toys. :roll:
So I can say yes there are redundant commands, but having the most used buttons right next to my work is a big deal. It would be nice if I could dock the Sketcher geometries and Sketcher constraints toolbars to my floating widget.

With a few changes to the macro could it be possible to model with the Properties panel closed and keep it closed? This would be a great test to see what it would take to start to simplify the human interface.

For the code writers: FreeCAD has issues with an empty sketch that has a feature and it's a Pad. My way of working around this is to set the Tip to the prior feature until I see doc.isTouched() == False
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: New macro " Wise1", targeting effeciency and sketch + feature

Post by chrisb »

freedman wrote: Thu Aug 25, 2022 5:08 am FreeCAD has issues with an empty sketch that has a feature and it's a Pad. My way of working around this is to set the Tip to the prior feature until I see doc.isTouched() == False
Isn't it to be expected that a feature doesn't work with an empty sketch?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
freedman
Veteran
Posts: 3441
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: New macro " Wise1", targeting effeciency and sketch + feature

Post by freedman »

Isn't it to be expected that a feature doesn't work with an empty sketch?
Yes, the problem is the current FreeCAD logic, if it can't make the Pad work, it disappears the model :) . It's hard to sketch on a model that you can't see so I set the Tip to the prior feature and the model appears. As soon as the sketch is valid (doc.isTouched() == False) the Tip can be moved to the current feature and the Pad appears. This seems to be good logic for empty or broken sketches.
Last edited by freedman on Thu Aug 25, 2022 6:16 am, edited 1 time in total.
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: New macro " Wise1", targeting effeciency and sketch + feature

Post by chrisb »

It should be sufficient to make the previous feature visible.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
freedman
Veteran
Posts: 3441
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: New macro " Wise1", targeting effeciency and sketch + feature

Post by freedman »

chrisb wrote
Is it possible to define the rotation axis for revolve and groove?
The best I could do: If you have sketched a valid Revolve or Groove the Combo view will change to the Parameters screen to select an axis.
It should be sufficient to make the previous feature visible.
Kind of true; In normal FreeCAD if you make a sketch & feature and then erase all the sketch elements the screen freezes with the last drawn solid showing. The screen is actually showing something that does not have a sketch base, but of coarse we know it's in an error condition. By moving the Tip to the prior feature the image is correct relative to what is drawn. That all gets weird :roll:.

I will keep testing but what I have works and can be discussed later.... I think what I show is actually better.

I also noticed that when FreeCAD creates a feature from a sketch it moves the Tip but it doesn't record the event in the python console, at least not that I see.
Thanks
Last edited by freedman on Thu Aug 25, 2022 8:30 pm, edited 1 time in total.
freedman
Veteran
Posts: 3441
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: New macro " Wise1", targeting effeciency and sketch + feature

Post by freedman »

Here is Wise2.
I added:
1) New options for Pad, Pocket, Revolve, Groove.
2) The dialog screen background color reacts to face selections. If the mouse selected face is part of the solid of the Active body the background color will be khaki, if the face selected is not in the Active body the color will be gold. Why!, when a sketch is created it is placed in the Active body, you can use the color scheme to ID the face with the current Active body.
3) Added option to Reverse the feature.

Usage:
Run the macro, click on a face and select the Sketch feature (in red) you want to create. The sketch and feature will be created for you and you will be in sketch 3D view (if selected). There are many prior videos.

Remember, most all the dialog works in Sketch edit mode.

All comments are welcome, coding, concept, additions, dislikes :( .

Edit: I guess I need another background color for No active body selected. I forgot about that condition.

Thanks :)
Attachments
Wise2.FCMacro
(34.13 KiB) Downloaded 24 times
Wise2.png
Wise2.png (117.35 KiB) Viewed 687 times
freedman
Veteran
Posts: 3441
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: New macro " Wise2", targeting effeciency and sketch + feature

Post by freedman »

The ActiveBody thing has been bugging me, I understand why we need one but maybe I can apply some logic to it's use. In my case a face is selected and then the user is clicking on creating a Sketch feature, it's obvious the user wants to create the Sketch feature on the selected solid. So I plan to do just that, if the user selects a face and then clicks on any of the create Sketch feature buttons the macro will change the ActiveBody to the target solid.
So now there is automatic ActiveBody selection, removing even more mouse movements, scanning the tree, double clicking.

None of this will affect the normal FreeCAD selection stuff but the Active Body could change as new feature objects are created, essentially the same thing that happens as we work in normal FreeCAD.

Edit: I also don't see any reason why the face selection couldn't be expanded to standard planes and Shapebinders. I could also do a pad for new Body creation, this could simplify creating a new Body with a sketch. I will select which plane to use in the dialog, this could create a Body and a sketch on Plane in one click. Someone was asking for that.....

Working on some changes........
freedman
Veteran
Posts: 3441
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: New macro " Wise2", targeting effeciency and sketch + feature

Post by freedman »

Here is Wise4. The macro has been rebuilt in many ways. It is even more powerful at saving time and energy creating models..
The macro now has these abilities:
A "New Body" button that will do this:
1) If there is no document one will be created, any following clicks will create a Body...ect.
2) The XY plane button is enabled by default on a new body creation , this plane target is used for Sketch feature creation.
3) The new Body creation will be made the Active body.
4) The body will be empty.

You can see in the video:
Initially there is no document so one is created (by a new body click), then a body is created followed by a selection of "Sketch Pad" and finally setting the drawing tool to circle. When Sketch Pad is clicked it will create a sketch using the plane selected. We follow this with an additional body creation, this time on the XZ plane using the circle tool. Next a face of one body is selected and a sketch feature is cut using a rectangle cut. This same thing is done to the other body.

Notice:
1) When a face is selected and Sketch feature is selected the target is changed to the active body.
2) Using the XY,XZ,YZ plane buttons will set the target support of a new Sketch feature.
3) Using a face selection and then a Sketch feature will make the target object the active body.

In the Report view a "Recompute failed" will be logged until elements are added to the new sketch.
Attachments
Wise4.FCMacro
(41.16 KiB) Downloaded 23 times
wise9.gif
wise9.gif (1020.81 KiB) Viewed 547 times
Post Reply