如何能通过API接口找到当前活动文档的SketchPlane?
2014-07-17 13:43
381 查看
问题如题
应该可以通过UIDocument.Document.ActiveView.SketchPlane 来获得。
另外View.SketchPlane 是一个可读写的。我们可以利用这个来给一个试图赋值新的工作平面。
看下面代码。 (代码来自:点击打开链接
作者:叶雄进原文链接:
转载请注明出处。http://blog.csdn.net/joexiongjin/article/details/37905079
应该可以通过UIDocument.Document.ActiveView.SketchPlane 来获得。
另外View.SketchPlane 是一个可读写的。我们可以利用这个来给一个试图赋值新的工作平面。
看下面代码。 (代码来自:点击打开链接
using System; using System.Collections.Generic; using System.Text; using Autodesk.Revit.Attributes; using Autodesk.Revit.DB; using Autodesk.Revit.UI; namespace Revit.SDK.Samples.HelloRevit.CS { [Transaction(TransactionMode.Manual)] public class Command : IExternalCommand { public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { UIApplication uiApp = commandData.Application; UIDocument uiDoc = uiApp.ActiveUIDocument; Transaction transaction = new Transaction(uiDoc.Document, "WorkPlane"); transaction.Start(); Plane plane = new Plane( uiDoc.Document.ActiveView.ViewDirection, uiDoc.Document.ActiveView.Origin); SketchPlane sp = uiDoc.Document.Create.NewSketchPlane(plane); uiDoc.Document.ActiveView.SketchPlane = sp; uiDoc.Document.ActiveView.ShowActiveWorkPlane(); transaction.Commit(); return Result.Succeeded; } } }
作者:叶雄进原文链接:
转载请注明出处。http://blog.csdn.net/joexiongjin/article/details/37905079
相关文章推荐
- 如果当前地图文档中有独立的Table,通过Engine如何获取该Table?
- 如何通过资源管理器取得当前的路径、焦点文件 msdn
- 如何通过T-SQL获得当前连接的客户端的IP和机器名...
- 如何通过批处理将子文件夹内的文件移动到当前文件夹
- 如何通过崩溃地址找到出错的代码行
- 如何让一个打开的文档成为活动文档
- 如何通过崩溃地址找到出错的代码行
- 如何得到当前活动的控件(判断那个控件得到了光标)
- 如何通过崩溃地址找到出错的代码行
- 如何通过T-SQL获得当前连接的客户端的IP和机器名
- 如何通过崩溃地址找到出错的代码行(ZT)
- 如何通过T-SQL获得当前连接的客户端的IP和机器名...
- 如何: 通过HTML文档对象模型访问文档中的ActiveX控件的属性
- 读“如何通过崩溃地址找到出错的代码行”有感 delphi示例
- 用自动化获取当前活动文档的路径及名称
- 如何通过活动目录(ADSI)修改IIS6中的 Web 服务扩展
- 如何在GridView中通过超级链接列打开服务器上的文档?
- 如何通过崩溃地址找到出错的代码行
- 如何防止主框窗口在其说明中显示活动的文档名
- mxOutlookBarPro中,button是通过for语句动态生成的,如何取得当前单击button的标题呢?