/// <summary> /// Executes the command. /// Asks the user for parameters and adds a Force Load to all Selected Joints. /// </summary> /// <param name="services">CommandServices object to interact with the system</param> public override void Run(Canguro.Controller.CommandServices services) { ForceLoad load = new ForceLoad(); //services.GetProperties(Title, load, false); if (Canguro.Controller.Grid.LoadEditFrm.EditLoad(load) == System.Windows.Forms.DialogResult.OK) { List<Item> selection = services.GetSelection(); foreach (Item item in selection) { if (item is Joint) ((Joint)item).Loads.Add((ForceLoad)load.Clone()); } services.Model.ChangeModel(); } }
private void readJointForce(XmlNode node) { uint id = uint.Parse(readAttribute(node, "Joint", "0")); string lcName = readAttribute(node, "LoadCase", "").Trim(); lcName = (lcName.Length > 0) ? lcName : Culture.Get("Case"); LoadCase lCase = model.LoadCases[lcName]; Joint obj = model.JointList[id]; if (obj != null && lCase != null) { AssignedLoads loads = obj.Loads; // readAttribute(node, "CoordSys", "GLOBAL"); ForceLoad load = new ForceLoad(); load.Fx = float.Parse(readAttribute(node, "F1", "0")); load.Fy = float.Parse(readAttribute(node, "F2", "0")); load.Fz = float.Parse(readAttribute(node, "F3", "0")); load.Mx = float.Parse(readAttribute(node, "M1", "0")); load.My = float.Parse(readAttribute(node, "M2", "0")); load.Mz = float.Parse(readAttribute(node, "M3", "0")); loads.Add(load, lCase); } }