WPF Revit Secondary Development Using Tree Structure to Display Revit Data
During function development, it is necessary to use attribute structures to make the Revit data structure itself clearer. When writing code, the MVVM pattern was adopted, and data collection and organization were completed in the backend. Recursive methods were used to classify the entire hierarchy.This article references: https://www.cnblogs.com/yeyunfei/p/5408931.html https://www.jianshu.com/p/908070cca109 https://www.cnblogs.com/larissa-0464/p/1022...
WPF revit二次开发使用树形结构显示revit数据
在功能研发时,需要使用属性结构让revit本身的数据结构更加的清晰,再写代码时采用了mvvm模式对,将数据采集整理再后端完成。利用递归的方式将整个层级进行分类。本文参照了:https://www.cnblogs.com/yeyunfei/p/5408931.html https://www.jianshu.com/p/908070cca109 https://www.cnblogs.com/larissa-0464/p/10227483.html 的案例。xaml代码: <TreeView Name="TreeView" ItemsSource="{Binding TreeNodes}" HorizontalAlignment="Left" Height="325" Margin="25,60,0,0" VerticalAlignment="...
Revit Secondary Development Project Coordinate Extraction Error Using Projection to Face
Today when writing code used face.Project node to get projection point, to realize attachment function to sloped face by modifying point. Did not find problem when using this node before. Today when testing if offset target to a very low point, using same projection to face node, finally caused a relatively large error. (If it is my own node usage error, hope to leave message to remind -.-!).Can see situation of two column caps offset. Under a relatively large offset, protecting upward will c...
Revit二次开发使用投影到面Project坐标提取错误
今天在写代码的时候使用face.Project这个节点取投影点,实现通过点的修改完成对斜面的附着功能。在之前使用这个节点的时候没有发现问题,今天测试时如果将目标便宜到很低的一个点,是同投影到面节点,最终会造成一个比较大的误差。(如果是自己的节点使用错误,希望能够留言提醒-。-!)。可以看到两个柱帽偏移的情形,在一个比较大的偏移量下,向上方投影会造成目标的偏移值出现较大的误差。通过几组简单的测试发现距离越大,最终的误差越多。之前调整柱帽是在一个楼板坡度较小而且距离较小的情况下进行测试,没有发现问题。通过人工测算,斜面情况下,目标据顶面在150mm以内数值调整时准确的。平面数值不影响。为了得到比较精确的调整,最后采用了射线相交法,通过 public ReferenceIntersector( ElementFilter filter, FindReferenceTarget targetType, View3D view3d ) 可以实现点的精确捕捉,因为我想调整到顶面,所以如果目标在下方想上方投影,需要将顶板厚度考虑进去,射线相交的第一个面为底面,如果不考虑厚度变量,最后会...
Linq语句中IEnumerable <T>判断为空办法
TIME : 2019-06-09 15:38:45 判断集合办法参考文章:https://blog.csdn.net/u010178308/article/details/77681573 在使用LINQ语句的时候会生成IEnumerable source的集合,在查询集合是否为空的时候一般采用source.count()的办法进进行查询,但是对于LINQ语句count无法返回我们想要的值。 Any()在LINQ语句查询时,使用if(!source.Any())进行集合为空的判断
Method to Check if IEnumerable <T> is Null in Linq Statement
Method to Check CollectionReference Article: https://blog.csdn.net/u010178308/article/details/77681573 When using LINQ statements, a collection of IEnumerable source will be generated. When querying whether the collection is empty, source.count() is generally used for connection query, but for LINQ statements, count cannot return the value we want. Any()When querying with LINQ statements, use if(!source.Any()) to check if the collection is empty.
ListView添加全选按钮
通过点击全选按钮将整个列表进行全选或取消#XML 12345678910<ListView Name="ListView" HorizontalAlignment="Left" Height="200" Margin="90,155,0,0" VerticalAlignment="Top" Width="175" > <ListView.View> <GridView> <GridViewColumn x:Name="Checks" > <GridViewColumn.Header> <CheckBox Name="Tf" Click="Check_Cli...
ListView Add Select All Button
Select all or cancel entire list by clicking select all button#XML 12345678910<ListView Name="ListView" HorizontalAlignment="Left" Height="200" Margin="90,155,0,0" VerticalAlignment="Top" Width="175" > <ListView.View> <GridView> <GridViewColumn x:Name="Checks" > <GridViewColumn.Header> <CheckBox ...
WPF DataGrid Excess Blank Rows Issue and Duplicate Binding Issue
When doing plugin development, hope to perform data interaction through DataGrid. Directly binding Itemsource will appear two identical columns Can eliminate by setting value of AutoGenerateColumns to False. If don’t want to display excess blank rows in list, need to set CanUserAddRowsto False
WPF DataGrid多于空白行问题与重复绑定问题
在做插件开发时,希望通过DataGrid进行数据交互。直接绑定Itemsource时会出现两个相同的列 可以通过将AutoGenerateColumns的值设置为False进行消除,如果不想在列表中显示多余的空行,需要将CanUserAddRows设置为False
Revit Secondary Development Attach Filter to Linked Model in Project
View filters are divided into rule filters and selection filters: Selection filter: Need to pass in elementId list to operate on specified Element Rule filter: Through rule description of specified parameters, pass in categories Id for operation Specifics can refer to API —update—2019 API deleted SET* command and model color specification method. Color attachment not tested, need to verify by yourself 1234567891011121314151617181920212223242526#if Revit2016 var filterEle...
Revit二次开发在项目中给链接模型附加过滤器
视图过滤器分为规则过滤器与选择过滤器: 选择过滤器:需要传入elementId列表对指定的Element进行操作 规则过滤器:通过对指定参数的规则描述,传入categeorys的Id进行操作 具体可参照API —update—2019 API删除掉SET*命令与模型颜色指定方法,颜色附加未实验,需要自己验证 1234567891011121314151617181920212223242526#if Revit2016 var filterElement = ParameterFilterElement.Create(document, name, categeorys); filterElement.SetRules(filterRules); view.AddFilter(filterElement.Id); document.Regenerate(); var overrideSe...
Revit墙体构造层修改与查询
Revit墙体构造层修改与查询一直想用博客记录下自己的一些问题和解决方案,今天是在CSDN上的第一篇博客,其余的会陆续从知乎转移过来 参考链接:https://blog.csdn.net/u010585773/article/details/83267911 在Revit中如果对墙体厚度进行数据查询,只需要访问WallType就可以,在修改相应的厚度是需要进入构造层:CompoundStructure 类似与我们使用中的新建厚度面板。里面提供了创建和修改构造层图层的方法 WallType type = WallTypes.ElementAt(0) as WallType; WallType newType = type.Duplicate(name) as WallType; //墙厚 CompoundStructure cs = type.GetCompoundStructure(); ...
Revit Wall Compound Layer Modification and Query
Revit Wall Compound Layer Modification and QueryAlways wanted to record some of my problems and solutions with blog. Today is first blog on CSDN, rest will be transferred from Zhihu successively. Reference Link: https://blog.csdn.net/u010585773/article/details/83267911 In Revit if querying wall thickness data, only need to access WallType. When modifying corresponding thickness need to enter structure layer: CompoundStructure similar to new thickness panel in our usage. It provides methods t...
Hello World
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub. Quick StartCreate a new post1$ hexo new "My New Post" More info: Writing Run server1$ hexo server More info: Server Generate static files1$ hexo generate More info: Generating Deploy to remote sites1$ hexo deploy More info: Deployment



