App.ActiveContainer

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: App.ActiveContainer

Post by DeepSOIC »

yorik wrote:One question, though. If you select a group, that group becomes the active container, right? So the active container can change while the draft autogroup is on, which is why you added an observer that updates the draft autogroup when needed. But wouldn't that be a bit against the very idea of that autogroup, that you have a "fixed" auto group that you are sure that it doesn't change? I have no clear idea on this...
The answer is simple. Either you have ActiveContainer that adds all new objects to a group or whatnot, or you have autogroup which does it. But not both at the same time.

We (me, ickby) decided that an object is not to be contained in two groups/Parts/whatnot simultaneously, because that leads to somewhat lot of extra trouble with assembly (for example, a contsrtaint then will have to remember the complete list of groups/parts/bodies to reach an object through, and updating that list when the structure is reorganized is hard).
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: App.ActiveContainer

Post by DeepSOIC »

Well, actually, after thinking about it a bit, I think it might be best to:
1. revert the original behavior.
Then, AutoGroup will probably create the group inside of active container, and put objects there.
2. If ActiveContainer doesn't contain the current AutoGroup's group, AutoGroup should create another group with a similar name inside of active container. Then it gets a little bit complicated, because name can't be the same.
I just don't want the auto-group to effectively prevent active container from working.
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: App.ActiveContainer

Post by yorik »

autogroup never creates any group (at least for now). It just holds a group name, and at the end of the command that adds a new object, that object is added to the given group.

I don't think this will conflict with activecontainer... What I suppose will happen:

1) you launch a Draft command, ex. Draft Line
2) a Part::FeaturePython object is created, which I suppose will trigger something related to ActiveContainer automatically?
3) ActiveContainer stuff will happen, and the new line will be added to the active container
4) at the end of the Draft Line command, the Draft autogrouping stuff is called, and will move the line to the Draft autogroup if needed.

So Draft autogroup would override ActiveContainer, which I think is the right behaviour. What do you think of that?
Post Reply