However, it's also interesting to note that the Act of Settlement doesn't only divert the succession away from the heirs of James II. It also takes care of other business, so to speak, elsewhere in the overall dynasty and in earlier generations. I'm referring for one example to the descendants of Henry VII through his younger daughter Mary Tudor, Queen of France, later Duchess of Suffolk, and her "heirs general".
Yes, you're right, this is interesting. Obviously the Act of Settlement tried to do it both ways: on the one hand it excluded the line of Charles I. via Henriette Anne Stuart, duchesse d'Orleans. Her heir today would be Franz of Bavaria. James II. line ended with Henry Stuart, the Cardinal - he died of course without issue - the other heirs would have been queen Mary II. and queen Anne and both did not leave issue as well, which led to the Act of Settlement).
Henriette Anne renounced her rights to the thrones of England and Scotland on her marriage to the brother of the French king, because she married the same year as the king himself, so any son of her had a serious chance to become king of France. Okay, the queen was faster in bearing children than the duchess and the queen gave birth to a dauphin, but noone could have known that in 1660 when the marriage contracts were drawn up.
The Act of Settlement did not discuss this problem of renounciation of inheritance rights on marriage because it wasn't an actual problem at that time - after all though James II. had died in 1701 around the time the Act was passed, there were still the Older and Younger Pretender and James II's widow Marie Meatrice of Modena trying to influence the French king and court at Versailles for their side.
And IMHO the authors of the Act knew what they did: there had been a princess before who had renounced her rights to the throne of England on marrying the king of Scotland: Margaret Tudor, elder sister of Henry VIII. Consequently her brother had thrown her line from
his line of succession as ruled by his will. But Elizabeth thought differently, especially when the family affairs of the Greys (heiresses via the line of princess Mary Tudor, younger sister of Henry VIII.) became muddled by claims of illegitimacy for the children of Catherine Grey and when Mary Grey died childless before Elizabeth's own death. So Elizabeth accepted that the legitimate line was via Margaret Tudor - James V.Stuart - Mary I.Stuart - James VI. Stuart.
But surely it made sense that the Act of Settlement removed these claimants, especially as they were "peers", so could have served to split the peerage into fractions which the Hanovers could not have done.