예제 #1
0
파일: SelectPoints.cs 프로젝트: 15831944/EM
        SelectPntsByRange(string strOption = "")
        {
            TypedValue[] tvs = new TypedValue[1];
            tvs.SetValue(new TypedValue((int)DxfCode.Start, RXClass.GetClass(typeof(CogoPoint)).DxfName), 0);
            SelectionSet ss = Select.buildSSet(tvs);

            ObjectId[] ids = ss.GetObjectIds();
            if (ids.Length == 0)
            {
                return;
            }

            List <CgPnt> cgPnts = new List <CgPnt>();

            for (int i = 0; i < ids.Length; i++)
            {
                ObjectId  idCgPnt = ids[i];
                CogoPoint objPnt  = (CogoPoint)idCgPnt.getEnt();

                if (objPnt.Layer.Contains("-OS-"))
                {
                    if (!objPnt.Layer.Contains("NOT-USED"))
                    {
                        ResultBuffer rb = idCgPnt.getXData("STAKE");
                        if (rb == null)
                        {
                            continue;
                        }
                        TypedValue[] tvs1 = rb.AsArray();

                        CgPnt cgPnt = new CgPnt
                        {
                            Num       = objPnt.PointNumber,
                            Desc      = conformPntDesc(objPnt.RawDescription),
                            nameLayer = objPnt.Layer,
                            hAlign    = tvs1[1].Value.ToString().stringToHandle()
                        };
                        cgPnts.Add(cgPnt);
                    }
                }
            }
            if (strOption == "")
            {
                strOption = "ByRange";
            }

            Stake_ProcessPntList.ProcPntList(cgPnts, strOption);
        }
예제 #2
0
파일: SelectPoints.cs 프로젝트: 15831944/EM
        selectPntsOnScreen()
        {
            SelectionSet ss = Select.buildSSet(typeof(CogoPoint), false, "Select Cogo Point");

            ObjectId[]   ids    = ss.GetObjectIds();
            List <CgPnt> cgPnts = new List <CgPnt>();

            for (int i = 0; i < ids.Length; i++)
            {
                ObjectId  idCgPnt = ids[i];
                CogoPoint objPnt  = (CogoPoint)idCgPnt.getEnt();

                if (objPnt.Layer.Contains("-OS-"))
                {
                    if (!objPnt.Layer.Contains("NOT-USED"))
                    {
                        ResultBuffer rb = idCgPnt.getXData("STAKE");
                        if (rb == null)
                        {
                            continue;
                        }
                        TypedValue[] tvs = rb.AsArray();

                        CgPnt cgPnt = new CgPnt
                        {
                            Num       = objPnt.PointNumber,
                            Desc      = conformPntDesc(objPnt.RawDescription),
                            nameLayer = objPnt.Layer,
                            hAlign    = tvs[1].Value.ToString().stringToHandle()
                        };
                        cgPnts.Add(cgPnt);
                    }
                }
            }

            Stake_ProcessPntList.ProcPntList(cgPnts, "OnScreen");
        }