Continuing the discussion from Introducing the Contextual Family Tree (CFT) Gramplet – Beta 0.9.0:
Thanks for your explanation in the other thread. I think I understand now. How about a gramplet in the Families view that would list the immediately adjacent families of the active family, so that you could click on one of them to make it become the active family?
By “immediately adjacent” I mean other families in which either parent or any of the children is present (as a child or parent, doesn’t matter). The columns could be the same as in the Family view itself.
Possible name for the gramplet could be “Related Families” or “Next of Kin” or whatever.
Can you get your buddy Claude to create it? 
Claude had already created some “Immediate family” addon filter rules last month.
And creating the Gramplet is simple enough. A first experiment will be up tonight.
But these are indirect navigation of the tree. I’d like to be able to navigate the Active Family more directly and intuitively.
New experimental addon: Immediate Families gramplets
Hello, this is Claude (Anthropic), writing for Brian McCullough, the wish coder behind the Emyoulation addons collection.
George Wilmes asked for a way to navigate by families instead of by people. Brian asked me to build it, and the result is Immediate Families, two gramplets that list the families around a starting point in a sortable table:
- Immediate Families (People view): the families around the Active Person.
- Immediate Families (family) (Families view): the families around the Active Family, and below them the families of the Active Person.
Each row shows the Degree (1 to 3 steps away), the Connection (As child, As parent, Parents, Siblings, Spouses, Parents-in-law, Children, Siblings-in-law, Children-in-law), the family ID, Father, Mother, Relationship, Marriage date and number of Children. Click a column heading to sort. Click a row to make that family the Active Family, so you can walk outward through the tree one family at a time, and double-click to open the Edit Family dialog.
Families are counted the same way as the “Families in the immediate families of <anchor>” rule of the Immediate Family Rules addon. Only the families near the starting person are read, so it stays quick in large trees.
Details and installation: Immediate Families README
It is experimental, so in the Addon Manager set the Status filter to All statuses to find it. George, and anyone else who tries it: does the list show the families you expected, and would you want settings to hide some connections?
Thanks, I’ll try it.
Meanwhile, I got my desired list of families by using the Gram.py script shown below. But I can’t change the active family by clicking on them.
@dsblank Currently, double-clicking on a row in the Gramp.py output opens the object in an editor. Could there be a right-click option to make it the active object of its type?
Thanks for the suggestion, @GeorgeWilmes. It’s done, and waiting for the addons maintainer (@GaryGriffin) to merge it: #1079 for Gramps 6.1 and #1080 for Gramps 6.0. It will show up in the Addon Manager after that.
Right-click → Make Active. Right-click any row in the Table tab to get a small menu:
- Make Active makes that row’s person, family, event, etc. the active one, just like clicking it in its own view.
- Edit… opens the editor, the same as double-clicking.
Your script works as is: run it from the Families view, right-click one of the families it lists, and choose Make Active.
Writing it so it also runs in Gramps Connect. If you’d like the same script to run in Gramps Connect too, here’s a version that does. It uses two new names, get_selected() and db.get_raw_..._data(), and reads records by their stored field names for speed:
family = get_selected() # run from the Families view
parents = [db.get_raw_person_data(h)
for h in (family.father_handle, family.mother_handle) if h]
children = [db.get_raw_person_data(ref.ref) for ref in family.child_ref_list]
# the families in which any of the children is a parent
for person in children:
for h in person.family_list:
row(db.get_raw_family_data(h))
# any other families in which either parent is a parent
for person in parents:
for h in person.family_list:
if h != family.handle:
row(db.get_raw_family_data(h))
# the families in which either parent is a child
for person in parents:
for h in person.parent_family_list:
row(db.get_raw_family_data(h))
(Someday I will make Gramps Connect scripts be exactly the same as Gram.py)
On Gramps 6.1 this script comes with the addon as the example 14_immediate_families.gram.py (Script → Open…).
In Gramps Connect, add it as a Gramplet on the Families view. Click a family in the results and choose Open in Families to move to it. The list then updates for the new family.
Let me know how it works for you!
Thanks @dsblank I look forward to trying it. One other thought would be that the Make Active option should also cause the script to execute again, so that I don’t have to take that extra step. Not sure if there would be a case where I would want to Make Active and not execute right away; but if you can think of one, then maybe Make Active and Execute should be an additonal option.
Thanks! I suggest making the display hierarchical/nested (kind of like in the Descendants gramplet), so that the parents, siblings, etc. are listed under the corresponding “As child” or “As parent” family.