zoukankan      html  css  js  c++  java
  • cad.net创建wipeout仅支持2008及以后版本

    using Autodesk.AutoCAD.Runtime;

    using Autodesk.AutoCAD.ApplicationServices;

    using Autodesk.AutoCAD.DatabaseServices;

    using Autodesk.AutoCAD.Geometry;

    namespace WipeoutApplication

    {

     public class Commands

     {

       [CommandMethod("CW")]

       public void CreateWipeout()

       {

         Document doc =

           Application.DocumentManager.MdiActiveDocument;

         Database db = doc.Database;

         Transaction tr =

           db.TransactionManager.StartTransaction();

         using (tr)

         {

           BlockTable bt =

             (BlockTable)tr.GetObject(

               db.BlockTableId,

               OpenMode.ForRead,

               false

             );

           BlockTableRecord btr =

             (BlockTableRecord)tr.GetObject(

               bt[BlockTableRecord.ModelSpace],

               OpenMode.ForWrite,

               false

             );

           Point2dCollection pts =

             new Point2dCollection(5);

           pts.Add(new Point2d(0.0, 0.0));

           pts.Add(new Point2d(100.0, 0.0));

           pts.Add(new Point2d(100.0, 100.0));

           pts.Add(new Point2d(0.0, 100.0));

           pts.Add(new Point2d(0.0, 0.0));

           Wipeout wo = new Wipeout();

           wo.SetDatabaseDefaults(db);

           wo.SetFrom(pts, new Vector3d(0.0, 0.0, 0.1));

           btr.AppendEntity(wo);

           tr.AddNewlyCreatedDBObject(wo, true);

           tr.Commit();

         }

       }

     }

    }

  • 相关阅读:
    IO流(5)—缓冲流
    vue-element-admin 中文问题
    npm 下载慢解决方案
    fatal: unable to connect to github.com
    为什么有sessionStorage,localStorage等,还需要vuex
    vuex页面刷新数据丢失的解决办法
    Node中JWT的使用
    socket.io 实现长连接演示代码
    WebSocket 实现长连接演示代码
    jquery ajax上传文件
  • 原文地址:https://www.cnblogs.com/swtool/p/3832328.html
Copyright © 2011-2022 走看看