//화면상에 점을찍을때 나타나는 마우스커서모양 지정 public KcsStat_point2D_req PointState(string cursortype, string defmode) { KcsPoint2D startpoint = new KcsPoint2D(0.0d, 0.0d); KcsPoint2D point = new KcsPoint2D(); KcsHighlightSet highlighter = new KcsHighlightSet(); KcsStat_point2D_req status = new KcsStat_point2D_req(); status.DefMode = defmode; KcsHighlightSet highlight = new KcsHighlightSet(); KcsCursorType Curtype = new KcsCursorType(); if (cursortype == "CrossHair") { Curtype.SetCrossHair(); } else if (cursortype == "RubberBand") { Curtype.SetRubberBand(startpoint); } else if (cursortype == "RubberRectangle") { Curtype.SetRubberRectangle(startpoint); } else if (cursortype == "RubberCircle") { Curtype.SetRubberCircle(startpoint); } else if (cursortype == "DragCursor") { Curtype.SetDragCursor(highlighter, startpoint); } status.Cursor = Curtype; return(status); }
public List <KcsPoint2D> selectByIndicate(int sel, string defmode = "ModeCursor") { List <KcsPoint2D> points = new List <KcsPoint2D>(); kcs_draft.HighlightOff(0); //--TB와 다르게 MarElementHandle OBJ는 핸들값을 handlePML()메소드를 통해서 handle을 비교해야 다른것을 알수 있다 //--그래서 !handleNums라는 Handle값을 가지는 Array를 통해서 비교로직을 추가로 구현하였다. //--그러나 Highlight를 위해서는 그냥 marelementhandle의 Array를 던져주면 동작한다. KcsStat_point2D_req status = PointState("CrossHair", defmode); while (true) { try { p1 = new KcsPoint2D(); int resp = kcs_ui.PointPlanarReq("Indicate Geomery", p1, status); KcsModel model = new KcsModel(); if (resp == kcs_util.OperationComplete()) { break; } if (resp == kcs_util.Ok()) { KcsElementHandle temp_handle = DetermineIdentify(sel); if (handler.Where(h => h.handle == temp_handle.handle).Count() != 0) { handler.RemoveAll(h => h.handle == temp_handle.handle); kcs_draft.HighlightOff(0); kcs_draft.ElementHighlight(handler.ToArray()); } else { points.Add(p1); handler.Add(temp_handle); kcs_draft.ElementHighlight(temp_handle); } } else if (resp == kcs_util.Reject()) { handler = new List <KcsElementHandle>(); points = new List <KcsPoint2D>(); break; } } catch (Exception) { kcs_ui.MessageNoConfirm("오류"); } } if (handler.Count == 0) { kcs_ui.MessageConfirm("선택된 모델이 없습니다. 종료합니다."); } kcs_draft.HighlightOff(0); return(points); //3D포인트 테스트 한 부분 //p1 = new KcsPoint2D(); //kcs_ui.PointPlanarReq("Indicate Geomery", p1, status); //KcsPoint3D p3 = new KcsPoint3D(); //// kcs_ui.PointReq() ////int resp = kcs_ui.PointPlanarReq("Indicate Geometry", p1); //int resp = kcs_ui.PointReq("Indicate Geometry", p3); //KcsElementHandle vh = kcs_draft.ViewIdentify("PLAN"); //p1 = kcs_draft.PointTransform(vh, p3); //if (resp == kcs_util.Ok()) //{ // KcsElementHandle handle = this.DetermineIdentify(sel); // handler.Add(handle); //} }