想获取项目浏览器中出现的所有标准族该用什么条件?
你直接用Family这个类名来获取就可以了。请看下面代码:<p>
</p><p> view plaincopy</p><p>public void GetAllStandardFamilies()</p><p>{</p><p> Application app = this.Application;</p><p> </p><p> Document doc = this.ActiveUIDocument.Document;</p><p> FilteredElementCollector collector = new FilteredElementCollector(doc);</p><p> collector.OfClass(typeof(Family));</p><p> string familyNames = null;</p><p> </p><p> foreach(Element elem in collector)</p><p> {</p><p> if(elem is Family)</p><p> {</p><p> Family f = elem as Family;</p><p> familyNames += f.Name + "\r\n";</p><p> }</p><p> </p><p> }</p><p> TaskDialog.Show("all families",familyNames); </p><p>}</p>转载请复制以下信息:
原文链接: http://blog.csdn.net/joexiongjin/article/details/9495281
作者:叶雄进 , Autodesk ADN
顶起来…………
页:
[1]