Revit API PickPoint过滤条件

//过滤选择,加上过滤条件,没有看出来差别。
[TransactionAttribute(Autodesk.Revit.Attributes.TransactionMode.Manual)]
public class cmd : IExternalCommand
{
    public Result Execute(ExternalCommandData commandData, ref string messages, ElementSet elements)
    {
        UIApplication uiApp = commandData.Application;
        Document doc = uiApp.ActiveUIDocument.Document;
        Selection sel = uiApp.ActiveUIDocument.Selection;

        Transaction ts = new Transaction(doc, "http://revit.5d6d.com");
        ts.Start();

        ObjectSnapTypes snapTypes = ObjectSnapTypes.Endpoints | ObjectSnapTypes.Intersections;
        //XYZ point = uiApp.ActiveUIDocument.Selection.PickPoint(snapTypes, "选择端点或交点:");
        XYZ point = uiApp.ActiveUIDocument.Selection.PickPoint("选择端点或交点:");
        TaskDialog.Show("info", point.ToString());

        ts.Commit();
        return Result.Succeeded;
    }
}
url:http://greatverve.cnblogs.com/p/pickpoint-ObjectSnapTypes.html
posted @ 2014-03-19 07:08  大气象  阅读(2478)  评论(0编辑  收藏  举报
http://www.tianqiweiqi.com