示例#1
0
        private void btn_Line_Click(object sender, EventArgs e)
        {
            LoadValue();

            var P1 = CAD.PickPoint();
            var P2 = CAD.PickPoint();

            var Line = CAD.CreateLine(P1, P2);
        }
示例#2
0
        public void Create()
        {
            using (Transaction T = Doc.TransactionManager.StartTransaction())
            {
                BlockTable BT = T.GetObject(DB.BlockTableId, OpenMode.ForRead) as BlockTable;

                BlockTableRecord BTR = T.GetObject(BT[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord;

                Point3d SP = new Point3d();
                Point3d EP = new Point3d(100, 0, 0);

                Line L = CAD.CreateLine(SP, EP);

                BTR.AppendEntity(L);
                T.AddNewlyCreatedDBObject(L, true);

                T.Commit();
            }
        }