* Mater-Pater

Writing and using plugins for Version 5 and above.
Post Reply
User avatar
Ron Melby
Superstar
Posts: 424
Joined: 15 Nov 2016 15:40
Family Historian: V6.2

Mater-Pater

Post by Ron Melby » 11 Oct 2019 16:16

is there a fh function or any efficient user function you can point me to, that:

given a root and a relation can tell me if it is a mother's side relation or a father's side relation?

I understand that a relation can be both, but fh doesn't seem to be put out by double cousins so much either.
FH V.6.2.7 Win 7 64 bit

User avatar
tatewise
Megastar
Posts: 16462
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: Mater-Pater

Post by tatewise » 11 Oct 2019 17:31

I don't think there is anything ready-made, so you will have to perform a tree traverse.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Jane
Site Admin
Posts: 7727
Joined: 01 Nov 2002 15:00
Family Historian: V6.2
Location: Somerset, England
Contact:

Re: Mater-Pater

Post by Jane » 12 Oct 2019 17:11

A fairly easy way to do this is to call the RelationCode function and do it on both parents to see which one is a direct line eg spouse_start flag is not set.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

User avatar
Ron Melby
Superstar
Posts: 424
Joined: 15 Nov 2016 15:40
Family Historian: V6.2

Re: Mater-Pater

Post by Ron Melby » 12 Oct 2019 17:27

local function matROOTS()
ptrFAMC = fhGetItemPtr(ptrROOT, '~.FAMC')
ptrFATHER:MoveTo(fhGetValueAsLink(ptrFAMC), '~.HUSB>')
ptrMOTHER:MoveTo(fhGetValueAsLink(ptrFAMC), '~.WIFE>')

tblROOTS[1] = ptrROOT
tblROOTS[2] = ptrFATHER
tblROOTS[3] = ptrMOTHER
end

its what I have done (or started, after some thought)
but.. there are issues.
FH V.6.2.7 Win 7 64 bit

User avatar
Jane
Site Admin
Posts: 7727
Joined: 01 Nov 2002 15:00
Family Historian: V6.2
Location: Somerset, England
Contact:

Re: Mater-Pater

Post by Jane » 13 Oct 2019 06:58

Ron that code does not call the RelationCode Function. Once you have added the code for that and put in the check for the spouse start and you have explained exactly what you are not getting I will look at this again. I am not going to write the code for you.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

User avatar
Ron Melby
Superstar
Posts: 424
Joined: 15 Nov 2016 15:40
Family Historian: V6.2

Re: Mater-Pater

Post by Ron Melby » 13 Oct 2019 13:03

yeah, I know that. as I said there are issues. I need to go thru my lineage table. that is my transformed relations, and change it. because I need to have a marker to determine consanguinty as well. wife's husband's niece, for example.

the mother fathers side, as I have discovered is not going to be much code, although heavy processing as it relates to any of the plugins I need it for, 3 relationship checks per individual, occasionally 2, sometimes none, over anywhere from 1600+ to 5600+ individuals depending on the plugin.
FH V.6.2.7 Win 7 64 bit

User avatar
Ron Melby
Superstar
Posts: 424
Joined: 15 Nov 2016 15:40
Family Historian: V6.2

Re: Mater-Pater

Post by Ron Melby » 13 Oct 2019 23:59

if ptrFATHER:IsNotNull() then
isf = fhCallBuiltInFunction('IsRelativeOf', ptrFATHER, iptr)
end
if ptrMOTHER:IsNotNull()then
ism = fhCallBuiltInFunction('IsRelativeOf', ptrMOTHER, iptr)
end



now where iptr is the same as the base pointer (father or mother) it is false. so ROOT, FATHER, MOTHER, hope that is all that is incorrect that I will need to fix.
FH V.6.2.7 Win 7 64 bit

User avatar
Jane
Site Admin
Posts: 7727
Joined: 01 Nov 2002 15:00
Family Historian: V6.2
Location: Somerset, England
Contact:

Re: Mater-Pater

Post by Jane » 14 Oct 2019 07:17

As I said use RelationCode and check for Spouse Start as well, you can't use IsRelativeOf as it will return true for "In laws"
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

User avatar
Ron Melby
Superstar
Posts: 424
Joined: 15 Nov 2016 15:40
Family Historian: V6.2

Re: Mater-Pater

Post by Ron Melby » 14 Oct 2019 11:25

fhCallBuiltInFunction('RelationCode', ptrFATHER, iptr, GENERATION, GENS_UP, GENS_DOWN, HALF, SPOUSE_START, SPOUSE_END, 1)

GENERATION, GENS_UP, GENS_DOWN, HALF, SPOUSE_START, SPOUSE_END

no way to do that in one fell swoop is there? get all the codes at once?
FH V.6.2.7 Win 7 64 bit

User avatar
Jane
Site Admin
Posts: 7727
Joined: 01 Nov 2002 15:00
Family Historian: V6.2
Location: Somerset, England
Contact:

Re: Mater-Pater

Post by Jane » 14 Oct 2019 16:05

What I do is use

Code: Select all

-- V6 Template
    local template = "Gens\. Up\=(%d+), Gens\. Down\=(%d+), Half\=(%d+), Spouse Start\=(%d+), Spouse End\=(%d+)"

    local code = fhCallBuiltInFunction('Relationship',pMain,pi,'CODE',i)
    local gensUp,gensDown,half,spouseStart,spouseEnd = string.match(code,template)   

    
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

Post Reply