int num1 = new FilteredElementCollector(doc, doc.ActiveView.Id).OfClass(typeof(Group)).ToList().Count;
if (num1 == 0)
{
MessageBox.Show("当前视图中无模型,请先放置模型");
return Result.Cancelled;
}