Revit二次开发基础知识

获取应用、文档及当前视图信息

public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {           
            
            UIApplication uiapp = commandData.Application;
            Application app = uiapp.Application;
            UIDocument uidoc = uiapp.ActiveUIDocument;
            Document doc = uidoc.Document;
            View view = commandData.View;
            LanguageType lt = app.Language;
            ProductType pt = app.Product;
            string s = "Application = " + app.VersionName
              + "\r\nLanguage = " + lt.ToString()
              + "\r\nProduct = " + pt.ToString()
              + "\r\nVersion = " + app.VersionNumber
              + "\r\nDocument path = " + doc.PathName // empty if not yet saved
              + "\r\nDocument title = " + doc.Title
              + "\r\nView name = " + view.Name;
            TaskDialog.Show("In",s);
            return Result.Succeeded;
        }

根据点集合连线 

                List<XYZ> corners = new List<XYZ>(4);
                corners.Add(XYZ.Zero);
                corners.Add(new XYZ(5, 0, 0));
                corners.Add(new XYZ(5, 10, 0));
                corners.Add(new XYZ(0, 10, 0));
                for (int i = 0; i < 4; ++i)
                {
                    Line line = Line.CreateBound(corners[i], corners[3 == i ? 0 : i + 1]);
                }

 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
>