//
过滤选择,加上过滤条件,没有看出来差别。
[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;
}
}
[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;
}
}