这个呢private string GetProjectParam(Autodesk.Revit.DB.Document revitDoc) { StringBuilder strBuild = new StringBuilder(); BindingMap map = revitDoc.ParameterBindings; DefinitionBindingMapIterator dep = map.ForwardIterator(); while (dep.MoveNext()) { Definition definition = dep.Key; string definitionName = definition.Name; ParameterType parameterType = definition.ParameterType; InstanceBinding instanceBinding = dep.Current as InstanceBinding; if (instanceBinding != null) { CategorySet categorySet = instanceBinding.Categories; strBuild.AppendLine(string.Format("Name:{0} Type:{1} CategorySet:{2}", definitionName, parameterType, categorySet.GetType().ToString())); } else { strBuild.AppendLine(string.Format("Name:{0} Type:{1}", definitionName, parameterType)); } } return strBuild.ToString(); }
时间: 2023-06-19 08:09:30 浏览: 71
rhino.inside-revit:这是Rhino.Inside:registered:.Revit的开源存储库
这段代码是用于获取 Revit 文档中所有参数绑定的信息。首先,它获取文档的参数绑定映射,然后遍历映射中的每个定义绑定。对于每个定义绑定,它获取定义的名称和参数类型,并检查当前绑定是否为实例绑定。如果是实例绑定,则获取它所绑定的类别集合,并将所有这些信息作为字符串追加到 strBuild 对象中。最后,它将 strBuild 对象转换为字符串并返回。
阅读全文