Automatically create body?

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
ian.rees
Posts: 517
Joined: Sun Jun 15, 2014 3:28 am
Contact:

Automatically create body?

Postby ian.rees » Sat Mar 18, 2017 10:07 pm

Just a little UI question - If there is no body at all, is there a situation where it would be wrong for FreeCAD to create a new body instead of popping up this modal? -Ian-

Screen Shot 2017-03-19 at 11.02.31 AM.png
Screen Shot 2017-03-19 at 11.02.31 AM.png (46.76 KiB) Viewed 99 times
DeepSOIC
Posts: 4422
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Automatically create body?

Postby DeepSOIC » Sat Mar 18, 2017 10:14 pm

Maybe. It may create a new body even if there are bodies already, just one isn't active. I think making New Sketch and Addtive <Primitive> commands may do it. Maybe datum features too, but that is more questionable. Remaining tools require input shapes that should be already in a body, so they shouldn't create bodies.
jnxd
Posts: 114
Joined: Mon Mar 30, 2015 2:30 pm

Re: Automatically create body?

Postby jnxd » Sun Mar 19, 2017 3:36 am

I was thinking on the same lines, though I planned to suggest making any available bodies active. We could have a dropdown of sorts, with one of the options being "add new body".

The message must also restrict the option to the parent body if, say a sketch is to be edited.
ian.rees
Posts: 517
Joined: Sun Jun 15, 2014 3:28 am
Contact:

Re: Automatically create body?

Postby ian.rees » Sun Mar 19, 2017 4:38 am

DeepSOIC wrote: Remaining tools require input shapes that should be already in a body, so they shouldn't create bodies.

Ahh, good point. So, perhaps it should only make the new body automatically for operations that don't depend on other shapes.

jnxd wrote:We could have a dropdown of sorts, with one of the options being "add new body".

I'm probably not following your suggestion, but generally I'm not a fan of adding UI elements when there's already UI for a particular task. To me, the modal popup makes sense when FreeCAD can't know what to do. I'm just suggesting that in the specific case of a document with no bodies, the "right" thing to do is sometimes obvious enough that it shouldn't require more clicks or any questions from FreeCAD.

Basically, the issue I have with the popup is that it adds a click to my usual workflow (which starts by making a sketch), where I don't see any benefit. Will think about it a bit more and maybe come up with some proposed code changes in a few days. -Ian-
jnxd
Posts: 114
Joined: Mon Mar 30, 2015 2:30 pm

Re: Automatically create body?

Postby jnxd » Sun Mar 19, 2017 5:03 am

ian.rees wrote:I'm probably not following your suggestion, but generally I'm not a fan of adding UI elements when there's already UI for a particular task. To me, the modal popup makes sense when FreeCAD can't know what to do. I'm just suggesting that in the specific case of a document with no bodies, the "right" thing to do is sometimes obvious enough that it shouldn't require more clicks or any questions from FreeCAD.

Basically, the issue I have with the popup is that it adds a click to my usual workflow (which starts by making a sketch), where I don't see any benefit. Will think about it a bit more and maybe come up with some proposed code changes in a few days. -Ian-

What I suggest is simply "You need an active body to perform this action. Please select a body to activate." and give the user the options, including creating a new body. This is only necessary if there are any bodies and we are not going to edit something already present. Indeed if there is no body, we should default to creating a new one automatically, and if the user is editing something, we should directly switch to the body the feature/sketch belongs to, or create a body and put said feature/sketch into it. However, when a body is made, the user might want to rename it, and in any case, we should indicate to the user that bodies are needed, just in case they don't know about PDN.
User avatar
kkremitzki
Posts: 314
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: Automatically create body?

Postby kkremitzki » Sun Mar 19, 2017 5:27 am

In this thread I talked about changing the "Create Body/Create Part" introductory Task Panel. I looked into it, and figured the most straightforward fix would be to add a button that has a "pick amongst the bodies in the document" button to replace the "create part" button. I wasn't sure if it would be worth implementing but I think it might be based on this thread.

If I made something like that, it could have an optional "before" message passed to it by e.g. the code that runs when you click a button and don't have an active part. That way, it would be something like:
|=============|
|- BodyPicker -|
|=============|
|<custom msg>|
|=============|
| - Workspace -|
|-|--> Body ----|
|-|--> Body001-|
| - Body002 --- |
| -Create body-|
|=============|


Then this could get called whenever a PartDesign button is clicked and no Body is found in the document.
ian.rees
Posts: 517
Joined: Sun Jun 15, 2014 3:28 am
Contact:

Re: Automatically create body?

Postby ian.rees » Sun Mar 19, 2017 6:11 am

jnxd - sorry I'm still not following, but there seems to be a lot more going on in your post than what I'm proposing. What I want is one less click in the workflow that goes "Start FreeCAD, create sketch, ...".

kkremitzki wrote:In this thread I talked about changing the "Create Body/Create Part" introductory Task Panel.

I think the Task Panel is problematic in general; I think most uses of it make FreeCAD too modal. But, that's diverging from this thread, I'll go post there...

Anyways, if I can get around to it in the next few days, I'll try to implement my proposed change and see what people think about it. -Ian-