Пример #1
0
        public override hresult PlaceObject(PlaceFlags lInsertType)
        {
            InputJig    jig = new InputJig();
            InputResult res = jig.SelectObject("Select Line");

            if (res.Result != InputResult.ResultCode.Normal)
            {
                return(hresult.e_Fail);
            }

            LineSeg3d line = res.Geometry.LineSeg;

            _pnt1 = line.StartPoint;
            _pnt2 = line.EndPoint;

            McObjectId id        = res.ObjectId;
            DbGeometry selection = id.GetObject();

            //if (selection.IsKindOf(DbPolyline.TypeID))
            //{
            //    MessageBox.Show("poly");
            //}
            //else if (selection.IsKindOf(DbLine.TypeID))
            //{
            //    MessageBox.Show("line");
            //}
            //else
            //{
            //    MessageBox.Show("Objecttype isn't valid");
            //    DbEntity.Erase();
            //    return hresult.e_Fail;
            //}
            DbEntity.AddToCurrentDocument();
            return(hresult.s_Ok);
        }
Пример #2
0
        public override hresult PlaceObject(PlaceFlags lInsertType)
        {
            InputJig    jig = new InputJig();
            InputResult res = jig.SelectObject("Select Line");

            if (res.Result != InputResult.ResultCode.Normal)
            {
                return(hresult.e_Fail);
            }

            LineSeg3d line = res.Geometry.LineSeg;

            poly = new Polyline3d(line);

            McObjectId id        = res.ObjectId;
            DbGeometry selection = id.GetObject();

            DbEntity.AddToCurrentDocument();
            return(hresult.s_Ok);
        }