[C#]紫爱leslie 17:00:12
[CommandMethod("ts3")] public static void tt3() { Document doc = Application.DocumentManager.MdiActiveDocument; Editor ed = doc.Editor; Database db = doc.Database; using (Transaction tr = db.TransactionManager.StartTransaction()) { Wipeout w = new Wipeout(); w.Orientation = new CoordinateSystem3d(new  oint3d(100, 100, 0), Vector3d.XAxis, Vector3d.YAxis); List pnts = new List(); pnts.Add(new  oint3d(100, 100, 0)); pnts.Add(new  oint3d(800, 100, 0)); pnts.Add(new  oint3d(800, 600, 0)); pnts.Add(new  oint3d(100, 600, 0)); pnts.Add(new  oint3d(100, 100, 0)); Matrix3d mat = w.PixelToModelTransform.Inverse();   oint2dCollection vers = new  oint2dCollection(); for (int i = 0; i < pnts.Count; i++) { pnts = pnts.TransformBy(mat); vers.Add(pnts.Convert2d(new lane())); } w.SetClipBoundary(ClipBoundaryType.Poly, vers); BlockTableRecord btr = (BlockTableRecord)db.CurrentSpaceId.GetObject(OpenMode.ForWrite); btr.AppendEntity(w); tr.AddNewlyCreatedDBObject(w, true); tr.Commit(); } }
wipeout的例子 |