首页 新闻 搜索 专区 学院

c# 二次开发AutoCAD

0
悬赏园豆:50 [待解决问题]

由原点,X轴和Y轴方向来决定UCS的位置、

用UcsTableRecord类的Origin,XAxis和YAxis三个属性获取原点,X轴和Y轴的方向。

想得到图纸上的所有X轴,原点信息 c#语言是怎么写的呢想问一下

_Lulu的主页 _Lulu | 初学一级 | 园豆:111
提问于:2018-09-18 11:25
< >
分享
所有回答(1)
0

// Editor Ed = Application.DocumentManager.MdiActiveDocument.Editor;
//Database Db = Application.DocumentManager.MdiActiveDocument.Database;
using (var trans = Db.TransactionManager.StartTransaction())
{

          var obj= trans.GetObject(Db.UcsTableId, OpenMode.ForRead);

            UcsTable t = obj as UcsTable;

            if (t != null)
            {
                foreach (var oId in t)
                {
                    var uceRec = trans.GetObject(oId,OpenMode.ForRead) as UcsTableRecord;
                    //XAxis是向量
                    Ed.WriteMessage("\n orange=[" + uceRec.Origin.X+","+ uceRec.Origin.Y + "," + uceRec.Origin.Z+ "]\n " 
                        +"XAxis:["+ uceRec.XAxis.X +","+ uceRec.XAxis.Y+ ","+","+ uceRec.XAxis.Z+ "]\n");

                }


            }

        }
HelloLLLLL | 园豆:186 (初学一级) | 2020-01-17 20:42
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册