コード例 #1
0
ファイル: PHS_lib.cs プロジェクト: xxxmen/PMLNET-PARKHYUNSOO
        /// <summary>
        ///  하나의 뷰를 선택하여 그 안에 있는 모든 모델핸들값을 가져오는 구문
        /// </summary>
        /// <param name="sel">0은 Subview</param>
        /// <param name="highlight">선택되서 캡쳐된 부분 하이라이팅 할 여부</param>
        public void Select_By_View(int sel, bool highlighting = true)
        {
            KcsElementHandle   viewhandle = new KcsElementHandle();
            KcsCaptureRegion2D region     = new KcsCaptureRegion2D();

            kcs_draft.HighlightOff(0);
            KcsElementHandle [] capturehandles = new KcsElementHandle[] {};
            int resp = 0;

            try{
                resp = kcs_ui.PointPlanarReq("원하는 뷰에 속하는 아이템을 찍으면 뷰가 선택됩니다.", p1);
                if (resp == kcs_util.Reject())
                {
                    return;
                }
                else
                {
                    viewhandle = kcs_draft.ViewIdentify(p1);
                    KcsRectangle2D temp_area = kcs_draft.ViewRestrictionAreaGet(viewhandle);


                    region.SetInside();
                    region.SetRectangle(temp_area);
                    region.SetNoCut();
                    capturehandles = this.DetermineCapture(sel);
                }
            }catch (Exception ee)
            {
                kcs_ui.MessageConfirm("캡쳐된 모델이 없습니다.");
            }
            finally{
                if (resp == kcs_util.Reject())
                {
                    if (highlighting == true)
                    {
                        kcs_draft.ElementHighlight(capturehandles);
                        kcs_ui.MessageNoConfirm("캡쳐된 Element 수량:" + capturehandles.Count().ToString());
                    }
                    handler = capturehandles.ToList();
                    kcs_draft.HighlightOff(0);
                    kcs_draft.ElementHighlight(capturehandles);
                }
                else
                {
                    kcs_draft.ElementHighlight(capturehandles);
                }
            }
        }
コード例 #2
0
ファイル: PHS_lib.cs プロジェクト: xxxmen/PMLNET-PARKHYUNSOO
        public void SelectbyBox(int sel = 3, int cut = 1)
        {
            try
            {
                handler = new List <KcsElementHandle>();
                int resp = kcs_ui.PointPlanarReq("첫번째 코너를 찍으세요", p1);
                if (resp == kcs_util.Reject() || resp == 253 || resp == 254)
                {
                    return;
                }
                KcsCursorType       cursor = new KcsCursorType();
                KcsStat_point2D_req stat   = new KcsStat_point2D_req();
                stat.Cursor = cursor;
                cursor.SetRubberRectangle(p1);

                int resp2 = kcs_ui.PointPlanarReq("두번째 코너를 찍으세요", p2, stat);
                if (resp2 == kcs_util.Reject() || resp2 == 253 || resp == 254)
                {
                    return;
                }
                kcs_draft.HighlightOff(0);
                KcsRectangle2D     rect   = new KcsRectangle2D(p1, p2);
                KcsCaptureRegion2D region = new KcsCaptureRegion2D();
                region.SetInside();
                region.SetRectangle(rect);
                region.Cut = cut;
                KcsElementHandle[] capturehandles = this.DetermineCapture(sel);
                kcs_draft.ElementHighlight(capturehandles);
                kcs_ui.MessageNoConfirm("캡쳐된 Element 갯수는: " + capturehandles.Count().ToString());
                handler = capturehandles.ToList();
                kcs_draft.HighlightOff(0);
            }
            catch (Exception ee)
            {
                kcs_ui.MessageConfirm("캡쳐된 Element가 없습니다.");
            }
        }