//point select private void button1_Click(object sender, EventArgs e) { selOb = null; //기본의 초기화!! textBox1.Text = ""; IsRunCatDoc(); // //catia 가 실행되어 있는지, 황성되어 있는 document가 있는지 sel = catia.ActiveDocument.Selection; object[] inputObjectType = { "Point" }; string Status; sel.Clear(); Status = sel.SelectElement2(inputObjectType, "Select a Point", true); if (Status != "Normal" || sel.Count < 1) { MessageBox.Show("선택한 point가 없습니다."); return; } INFITF.SelectedElement selItem; selItem = sel.Item(1); textBox1.Text = ((INFITF.AnyObject)selItem.Value).get_Name(); selOb = (INFITF.AnyObject)selItem.Value; }
//line 선택하기--------------------------------------------------------- private void button1_Click(object sender, EventArgs e) { sel = null; //action 시작할때 초기화할것! if (catia == null) { MessageBox.Show("Pleace run the CATIA"); return; //이게 없으면 오류난다. } if (catia.ActiveDocument == null) { MessageBox.Show("활성된 문서가 없습니다."); return; //이게 없으면 오류난다. } //line 선택 sel = catia.ActiveDocument.Selection; /////??? object[] inputObTyp = { "Line" }; sel.Clear(); string status = sel.SelectElement2(inputObTyp, "Select a line", true); if (status != "Normal") { MessageBox.Show("선택한 Line이 없습니다. "); return; } if (sel.Count < 1) { MessageBox.Show("line를 선택해주세요"); return; } //line 이름을 표시한다 textBox1.Text = ((INFITF.AnyObject)sel.Item(1).Value).get_Name(); }
//select a plan--------------------------------------- private void bselPlt_Click(object sender, EventArgs e) { IsRunCatDoc(); selOb = null; //기본의 초기화!! textBox3.Text = ""; sel = catia.ActiveDocument.Selection; object[] inputObjectType = { "Plane" }; string Status; sel.Clear(); Status = sel.SelectElement2(inputObjectType, "Select a Plane", true); if (Status != "Normal" || sel.Count < 1) { MessageBox.Show("선택한 Plane가 없습니다."); return; } INFITF.SelectedElement selItem; selItem = sel.Item(1); textBox3.Text = ((INFITF.AnyObject)selItem.Value).get_Name(); selOb = (INFITF.AnyObject)selItem.Value; }
//point만 선택한다-------------------------------- private void button1_Click(object sender, EventArgs e) { selob = null; if (catia == null) { MessageBox.Show("catia를 실행 해주세요."); return; + } if (catia.ActiveDocument == null) { MessageBox.Show("활성 document가 없습니다."); return; } object[] intype = { "Point" }; //catia.ActiveDocument.Selection.SelectElement2(intype,"Select a Point",true); //esc -> cancel string status; sel.Clear(); status = sel.SelectElement2(intype, "Select a Point", true); if (status != "Normal" || sel.) { MessageBox.Show("선택한 정보가 없습니다."); return; } //textBox1.Text = sel.get_Name(); //sel = catia.ActiveDocument.Selection; // string name = textBox1.Text; // HybridShapeTypeLib.Point p = (HybridShapeTypeLib.Point)sel.FindObject("Point"); // sel.set_Name(name); }
private void textBox1_MouseClick(object sender, MouseEventArgs e) { // 카티아가 실행중? if (Catia == null) { //MessageBox.Show("Please run CATIA"); label3.Text = "Please run CATIA"; return; } // 활성 문서가 있는가? if (Catia.ActiveDocument == null) { //MessageBox.Show("활성 문서가 없습니다"); label3.Text = "활성 문서가 없습니다"; } // 선택 기능 실행 Sel = Catia.ActiveDocument.Selection; Object[] InputObjectType = { "HybridBody" }; string Status; Sel.Clear(); Status = Sel.SelectElement2(InputObjectType, "Select a Geometrical Set", false); if (Status != "Normal") { label3.Text = "취소"; return; } if (Sel.Count < 1) { label3.Text = "선택"; return; } SelGS = (HybridBody)Sel.Item(1).Value; textBox1.Text = SelGS.get_Name(); int ptCount = 0; for (int i = 1; i <= SelGS.HybridShapes.Count; i++) { ptCount++; Pts.Add(SelGS.HybridShapes.Item(i)); } label4.Text = ptCount + ""; }
//select an end point private void button2_Click(object sender, EventArgs e) { //obj = null; sel = catia.ActiveDocument.Selection; sel.Clear(); object[] inputObjType = { "Point" }; string status = sel.SelectElement2(inputObjType, "Select a end point", false); if (status != "Normal" || sel.Count < 1) { MessageBox.Show("Select a start point."); return; } ptEnd = sel.Item(1).Reference; }
private void button2_Click(object sender, EventArgs e) { // 카티아가 실행중? if (Catia == null) { //MessageBox.Show("Please run CATIA"); label1.Text = "Please run CATIA"; return; } // 활성 문서가 있는가? if (Catia.ActiveDocument == null) { //MessageBox.Show("활성 문서가 없습니다"); label1.Text = "활성 문서가 없습니다"; } // Point 선택 기능 실행 INFITF.Selection Sel = null; Sel = Catia.ActiveDocument.Selection; Object[] InputObjectType = { "Line" }; string Status; Sel.Clear(); Status = Sel.SelectElement2(InputObjectType, "Select an Line", false); if (Status != "Normal") { label1.Text = "취소됨"; return; } if (Sel.Count < 1) { label1.Text = "선택했나"; return; } //INFITF.SelectedElement SelObj = null; // 아이템 생성 SelObj = (INFITF.AnyObject)Sel.Item(1).Value; textBox2.Text = SelObj.get_Name(); }