PickBox 是Revit二次开发里经常会用到的交互方式,这里对里面的各参数所对应的交互效果进行讲解。
class PickBox : IExternalCommand
{
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
RevitSelection selection = commandData.Application.ActiveUIDocument.Selection;
//从左到右和从右到左都是虚线
var pickedBox1 = selection.PickBox(PickBoxStyle.Crossing);
//从左到右是实线,从右到左都是虚线
var pickedBox2 = selection.PickBox(PickBoxStyle.Directional);
//从左到右和从右到左都是实线
var pickedBox3 = selection.PickBox(PickBoxStyle.Enclosing);
//添加状态提示
var pickedBox4 = selection.PickBox(PickBoxStyle.Directional,"这里可以设置交互提示。");
return Result.Succeeded;
}
}
如果你对Revit二次开发感兴趣,欢迎关注我的公众号一起学习~