OK, I've been able to sequence my way down through the hierarchy of components/occurrences, within my Add-Ins C++ Script, and now have indeed gotten access to the Occurrence that I want (Rocket Engine Unit:1, shown in green), the one that has the Joint that I'm trying to gain access to ("Rev Rocket Engine Unit", shown in red).

But when I access that Occurrence's joints property it has ZERO entries. When I access the Occurrence's asBuiltJoints property the list is NULL. Yet, according to the Browser hierarchy, there it is, the "Rev Rocket Engine Unit 1" joint that I want to gain access to.
Here's the method I wrote to get access to the joint. It gets passed in the Occurrence within which the joint resides plus the name of the joint I'm trying to access. And even though the Joint does indeed reside with the occurrence (according to the Browser) my method fails to access it. (The "Show" method simply displays the text in a dialog box so I can track along with what it's doing).
Does anyone have any idea what I'm doing wrong, or why the joint shows in the browser but seems to be not accessible via the API?
//
// GET JOINT NAME FROM OCCURRENCE
//
Ptr<Joint> GetJointByNameFromOccurrence(Ptr<Occurrence> TheOccurrenceToSearch, std::string DesiredJointName)
{
// We first look in the (normal) joints list and then in the As Built Joints List.
Show("IN GetJointByNameFromOccurrence(" + TheOccurrenceToSearch->name() + ", " + DesiredJointName);
Ptr<Joint> TheFoundJoint = NULL; // Assume that we're not going to find it.
Ptr<JointList> JointsList = TheOccurrenceToSearch->joints();
if (JointsList)
{
Show("IN GetJointByNameFromOccurrence looking for " + DesiredJointName + "\nJointsList has " + std::to_string(JointsList->count()) + "regular joints");
TheFoundJoint = JointsList->itemByName(DesiredJointName);
if (TheFoundJoint)
{
return TheFoundJoint;
}
}
else
{
Show("NO REGULAR JOINTS");
}
Ptr<JointList> AsBuiltJointsList = TheOccurrenceToSearch->asBuiltJoints();
if (AsBuiltJointsList)
{
Show("IN GetJointByNameFromOccurrence looking for " + DesiredJointName + "\nAsBuiltJointsList has " + std::to_string(AsBuiltJointsList->count()) + "joints");
TheFoundJoint = AsBuiltJointsList->itemByName(DesiredJointName);
}
else
{
Show("NO AS-BUILT JOINTS");
}
return TheFoundJoint;
}