public void SetRobotFixMechanism(Form FM, INFITF.Document document, Mechanism mechanism) { Selection Uselect = GetInitTargetProduct(FM, document, "请选择固定的对象!"); if (Uselect == null) { return; } mechanism.FixedPart = (Product)Uselect.Item(1).Value; Uselect = GetInitTargetProduct(FM, document, "请选择固联的对象!", true); if (Uselect == null) { return; } try { Reference reference = Uselect.Item(1).Reference; Reference reference1 = Uselect.Item(2).Reference; AnyObject[] RefenceObject = new AnyObject[] { reference, reference1 }; Joint joint = mechanism.AddJoint("CATKinRigidJoint", RefenceObject); mechanism.Update(); } catch (Exception) { throw; } }