There is a function published interface to create bone links.
BoneSys.createBone <startPosition> <endPosition> <zAxis>
The location of the new bone as point3
The direction (X axis) of the bone and the bone length as point3
The direction of the Z axis for the new bone node as point3
This returns the new bone node that was created.
If the Z axis is not perpendicular to the X axis, the Z axis will be made perpendicular. To create a bone chain, call createBone repeatedly with the startPosition set to the value of the previous endPosition. Note that newly created bones are not linked to any parent. So to create a bone chain, the script would also need to link each newly created bone segment to the previous.
Bones : System
Node Common Properties, Operators, and Methods
Bone : Helper
Skin : Modifier
Access to the New Node Bone Properties and Methods