public void myItems_set(object sender, Tecnomatix.Engineering.TxSelection_ItemsSetEventArgs args) { try { if (isEditForm) { sourceLocation_tb.Object = args.ObjectList[0]; ITxRoboticOperation ro = sourceLocation_tb.Object as ITxRoboticOperation; string[] strs = new string[ro.Commands.Count]; int i = 0; foreach (TxRoboticCommand co in ro.Commands) { strs[i] = co.Text; i++; } richTextBox_sourceOLP.Text = string.Join("\n", strs); } else { foreach (ITxObject obj in args.ObjectList) { txObjGridCtrl_targetLocation.AppendObject(obj); } } } catch { } }
private void button7_Click(object sender, EventArgs e) { ITxRoboticLocationOperation ro = txObjEditBoxCtrl1.Object as ITxRoboticLocationOperation; ITxTypeFilter objFilter = new TxTypeFilter(typeof(ITxRoboticLocationOperation)); TxObjectList obj = ro.ParentRoboticOperation.GetAllDescendants(objFilter); try { for (int i = 0; i < obj.Count; i++) { if (obj[i + 1] is TxWeldLocationOperation) { string str = ";-- " + obj[i + 1].Name + " --"; ITxRoboticOperation rop = obj[i] as ITxRoboticOperation; if (rop.Commands.Count == 0) { rop.CreateCommand(new TxRoboticCommandCreationData(str)); } else { TxRoboticCommand rc = rop.Commands[rop.Commands.Count - 1] as TxRoboticCommand; if (!rc.Text.Contains("_ps_")) { rop.CreateCommand(new TxRoboticCommandCreationData(str)); } } } } } catch (System.Exception ex) { } }
/// <summary> /// 拾取源轨迹点 /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private void txObjEditBoxCtrl1_Picked(object sender, Tecnomatix.Engineering.Ui.TxObjEditBoxCtrl_PickedEventArgs args) { try { ITxRoboticOperation ro = args.Object as ITxRoboticOperation; string[] strs = new string[ro.Commands.Count]; int i = 0; foreach (TxRoboticCommand co in ro.Commands) { strs[i] = co.Text; i++; } richTextBox_sourceOLP.Text = string.Join("\n", strs); } catch { } }