private void BoltArray()
{
TSMU.Picker _picker = new TSMU.Picker();
ModelObject mo = _picker.PickObject(TSMU.Picker.PickObjectEnum.PICK_ONE_PART);
TSG.Point p1 = _picker.PickPoint();
TSG.Point p2 = _picker.PickPoint();
Part cp = mo as Part;
TSM.BoltArray B = new TSM.BoltArray();
B.PartToBeBolted = cp;
B.PartToBoltTo = cp;
B.FirstPosition = p1;
B.SecondPosition = p2;
B.BoltSize = 20;
B.Tolerance = 2.00;
B.BoltStandard = "TS10.9";
B.BoltType = BoltGroup.BoltTypeEnum.BOLT_TYPE_WORKSHOP;
B.Length = 150;
B.ThreadInMaterial = BoltGroup.BoltThreadInMaterialEnum.THREAD_IN_MATERIAL_NO;
B.Position.Depth = Position.DepthEnum.MIDDLE;
B.Position.Plane = Position.PlaneEnum.MIDDLE;
B.Position.Rotation = Position.RotationEnum.FRONT;
B.AddBoltDistX(100);
B.AddBoltDistX(90);
B.AddBoltDistX(80);
B.StartPointOffset.Dx = 100;
B.AddBoltDistY(70);
B.AddBoltDistY(60);
B.AddBoltDistY(50);
B.EndPointOffset.Dy = 200;
//B.Nut1 = false;
//B.Nut2 = false;
//B.Washer1 = false;
//B.Washer2 = false;
//B.Washer3 = false;
B.Bolt = false;
if(!B.Insert())
{ MessageBox.Show("BoltArray insert failed."); }
model.CommitChanges();
}