More helpful "need active body" message

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
Meetlat
Posts: 72
Joined: Tue Oct 13, 2020 7:00 am

Re: More helpful "need active body" message

Post by Meetlat »

Seems to me like a great enhancement!
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: More helpful "need active body" message

Post by GeneFC »

jnxd wrote: Wed Jul 28, 2021 7:54 pm I would definitely skip doing it if the response was overwhelmingly negative, or if there was a reason apart from "it wouldn't be that useful".
My only serious comment was that it did not appear to be useful for me. I am certainly not opposed unless it creates problems.

If others find it useful, great.

Gene
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: More helpful "need active body" message

Post by jnxd »

Just an update on the progress on this thing. I've replaced the combo-view with a list and now most of the part design commands use the new dialog. Haven't done the better default selection, though. Additionally, the default action seems to be to create a new body if you just click OK without selecting anything. If anyone could help me out with this Qt related issue I'm having that'd be great.
My latest (or last) project: B-spline Construction Project.
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: More helpful "need active body" message

Post by jnxd »

chrisb wrote: Ping
@chrisb, would you have some time to take a look at the needActiveBodyMessage() function and tell me how I could improve the logic to find the selected item?
My latest (or last) project: B-spline Construction Project.
chrisb
Veteran
Posts: 54150
Joined: Tue Mar 17, 2015 9:14 am

Re: More helpful "need active body" message

Post by chrisb »

jnxd wrote: Thu Jul 29, 2021 5:13 pm @chrisb, would you have some time to take a look at the needActiveBodyMessage() function and tell me how I could improve the logic to find the selected item?
I'm sad to say, but I'm the wrong person to answer this. I understand near to nothing from this code.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: More helpful "need active body" message

Post by jnxd »

chrisb wrote: Thu Jul 29, 2021 5:32 pm
jnxd wrote: Thu Jul 29, 2021 5:13 pm @chrisb, would you have some time to take a look at the needActiveBodyMessage() function and tell me how I could improve the logic to find the selected item?
I'm sad to say, but I'm the wrong person to answer this. I understand near to nothing from this code.
Thanks for replying, Chris. I just pinged you because you were the most active person who's interested in this. Do you know anyone who could help?
My latest (or last) project: B-spline Construction Project.
chrisb
Veteran
Posts: 54150
Joined: Tue Mar 17, 2015 9:14 am

Re: More helpful "need active body" message

Post by chrisb »

Can you help out?
openBrain wrote: pinged by pinger macro
TheMarkster wrote: pinged by pinger macro
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
TheMarkster
Veteran
Posts: 5508
Joined: Thu Apr 05, 2018 1:53 am

Re: More helpful "need active body" message

Post by TheMarkster »

In a combobox you can use currentIndex() to find the currently selected item.

https://doc.qt.io/qt-5/qcombobox.html#currentIndex-prop
TheMarkster
Veteran
Posts: 5508
Joined: Thu Apr 05, 2018 1:53 am

Re: More helpful "need active body" message

Post by TheMarkster »

To get the body that contains the active object currently selected:

Code: Select all

PartDesign::Body* bodyOfActiveObject = PartDesign::Body::findBodyOf(doc->getActiveObject());
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: More helpful "need active body" message

Post by openBrain »

chrisb wrote: Thu Jul 29, 2021 9:46 pm Can you help out?
TheMarkster already said it all (except I guess that 'activeObject' can be different from the selected item in some cases).
I quickly read the thread, and should say I would prefer a list rather than a combo box too. Especially if double-click is supported. ;)
Post Reply