【发布时间】:2018-02-28 16:54:55
【问题描述】:
如果我在项目文档中运行此代码,一切都会完美,但是在家庭文档中时,我会收到错误。
代码
Document pDoc = uiapp.ActiveUIDocument.Document;
FilteredElementCollector fec = new FilteredElementCollector(pDoc);
IList<Element> ec = fec.OfClass(typeof(FamilySymbol)).OfCategory(BuiltInCategory.OST_SpecialityEquipment).ToElements();
错误
异常信息:
函数的输入参数“文档” `anonymous-namespace'::FilteredElementCollector_constructor 或一个 集合中的项目在文件的第 326 行为空 ...\APIFilteredElementCollectorProxy.cpp.
参数名称:文档
堆栈跟踪:
at ?A0x3fe3c5fb.FilteredElementCollectorProxy_constructor(文档文档)
在 Autodesk.Revit.DB.FilteredElementCollector..ctor(文档文档)
myNamespace.myExternalCommandName.Execute(UIApplication uiapp)
【问题讨论】: