2016 RevitAPI Batch Generate Multiple Components
Today I found a quite interesting class searching the API: FamilyInstanceCreationDataBy passing parameters, you can use doc.Create.NewFamilyInstances2() to generate all components at once.This class can be used for modeling or adjusting components. The method comes with two methods. .axis && .RotateAngle can save the steps of using ElementTransformUtils.RotateElement() after generating components before. It is more concise at call level than generating one by one before. The time diff...
2016RevitAPI一次性生成多个构件
今天检索API发现一个比较有意思的类:FamilyInstanceCreationData通过传入参数可以使用doc.Create.NewFamilyInstances2()一次生成所有构件。这个类可以用于翻模或调整构件的情况。在方法中自带两种方法.axis&&.RotateAngle可以省却我之前生成构建后ElementTransformUtils.RotateElement()使用的步骤,比以前挨个生成在代码层面要简洁一些,目前还未测试出时间差别。下面是官方里面的示例。 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455ICollection<ElementId> BatchCreateColumns(Autodesk.Revit.DB.Document document, Level level){ List<FamilyInstanceCreationData> fi...
Issue where modifying List A also modifies List B
Reference ArticleToday, while programming, I performed list conversion and simultaneously deleted items from the converted list. 12List<XYZ> A = firList; A.RemoveAt(0); I found that after deleting from A, the firList was also deleted.The specific reason hasn’t been investigated clearly yet. I assume it’s because of memory usage, causing both lists to operate simultaneously. The exact reason is not verified, leaving a note to update later. 123List<XYZ> newFirList = n...
修改A列表同时B列表同时修改的问题记录
引用文章今天在编程时进行列表的转换,同时对转换后列表进行删除操作。 12List<XYZ> A = firList; A.RemoveAt(0); 发现对A进行删除操作后,firList的列表也会随之进行删除。具体原因目前没有查清,估计是因为内存占用的原因,导致两个列表会同时进行操作,具体原因未查清,插个旗子后面补充。 123List<XYZ> newFirList = new List<XYZ>();newFirList.AddRange(firList);newFirList.RemoveAt(0); 后面通过对列表firList进行clone操作,这样两个列表的值可以互不影响。
Solution to "You have no right to access this object because of bucket acl"
Transferring data via OSS, the console reported an error. Through Aliyun issues, it was found that the user permissions were insufficient. The specific solution is to modify the user’s permissions.Operation link: https://help.aliyun.com/document_detail/42777.html?spm=5176.10421674.pdt_dtl.14.8a8067a4I0s2V7#h_58606841522771572256204296
You have no right to access this object because of bucket acl.问题解决办法
通过OSS传递数据,传递是控制台报错, 通过阿里云问题发现是用户权限不够,具体解决办法修改用户的权限。操作链接:https://help.aliyun.com/document_detail/42777.html?spm=5176.10421674.pdt_dtl.14.8a8067a4I0s2V7#h_58606841522771572256204296
SpringMvc Mapping Cannot Enter Issue
When creating project file upload/download function, due to accidental deletion of maven package, later retrieved via updata. After series of retrievals found project suddenly 404;Checked mapping and index.xml files no problem. Then remembered retrieving WebContext in updata in project found Web.xml inside was not set, causing project unable to map. After deleting folder project returned to normal. Record it to prevent forgetting how to fix after accidental hand slip in future!!!
SpringMvc 映射无法进入的问题
在进行项目文件上传下载功能的创建时,由于手贱误删maven包后期通过updata 进行找回,进行一系列找回后发现项目突然之间404;查找映射与index.xml文件均无问题。之后想起检索项目中updata是的WebContext发现里面Web.xml没有进行设置,导致项目无法进行映射。将文件夹删除后项目回复正常。记录一下,防止以后手贱忘记如何修复!!!
Get All Rooms in Project
element and room classes in revit are not connected. To get all room classes in project need 1var rooms = collector.OfCategory(BuiltInCategory.OST_Rooms).OfClass(typeof(SpatialElement)).ToElements(); To get.
获取项目内所有的房间
revit中element与room类不想通,想要取得项目中所有的room类需要 1var rooms = collector.OfCategory(BuiltInCategory.OST_Rooms).OfClass(typeof(SpatialElement)).ToElements(); 获取。
矢量法求点到线段的距离
参考博客:https://www.cnblogs.com/lyggqm/p/4651979.html通过对向量进行计算,将点到线段的计算通过两个值比较计算点的三种概率,再线段内,线段的左右两侧。通过计算可以快速将点到线段的距离求出。具体理论再参考博客给出。在Revit二次开发中,需要求点到线段最短距离,在API中有Curve.Distance可以求出,也可以使用三角函数将角度求出不过这种方法没有完全测试,总觉得会出现比较麻烦的地方。在求最短距离是,使用矢量法求出颠倒线段的距离,当点在线段外侧是,会将三角形长边c取出,这时候可以求出两者的角度α,再次利用三角函数将垂直边取出,获得最短距离。
Vector Method to Find Distance from Point to Line Segment
Reference Blog:https://www.cnblogs.com/lyggqm/p/4651979.htmlBy calculating vector, calculating point to line segment through comparing two values to calculate three probabilities of point, inside line segment, left and right sides of line segment. Through calculation can fast find distance from point to line segment. Specific theory refer to blog given.In Revit secondary development, need to find shortest distance from point to line segment. In API there is Curve.Distance can find, can also u...
Revit Secondary Development Structural Column Solid.Faces Value Issue
Due to project needs, needed to get values for top face of structural column. Found edge length value error when retrieving top face values. Found 6 edges retrieved from top face through lookup :(Impossible for a rectangular column. But didn’t think clearly why extra two values were retrieved, and only one edge length matched column itself. First retrieval used direct geometry from familyinstance, found error, then correct after retrieving symbol first then top face values. Initial thought is...
Revit二次开发结构柱Solid.Faces取值出现问题
由于项目需要,需要对结构柱顶面进行取值。在对顶面取值中发现edge长度取值错误,通过lookup发现取出顶面含有六条边:(作为一个矩形柱是不可能的事情。但是没有思考清楚问什么会出现多取两个值的情况,而且里面边长只有一个符合柱本身需求。 第一次取值使用的是familyinstance情况下直接取geometry,发现错误后通过先对symbol取值再取顶面值会正确。初步想法是由于顶面与其他构件连接造成的geometry取值错误。
WPF TreeView Binding Revit Data
This article referencesAuthor: SmlAntSource: http://www.cnblogs.com/smlAntNote: Please retain the above content and indicate the author and source when reprinting.The article contains many useful knowledge points.When making functional requirements, the Treeview command is needed, and in the production process, it was found that the hierarchical structure of TreeView conforms to the hierarchical structure of Revit, which can make the data display more clearly. 12345678910111213141516171819202...
WPF Treeview绑定Revit数据
本文参照作者:SmlAnt 出处:http://www.cnblogs.com/smlAnt 注意:转载请保留以上内容,并标作者和出处。 文章有很多有很多有用的知识点在制作功能需求是需要用到Treeview命令,而且在制作过程中发现TreeView的层次架构符合Revit的层次结构,能够让数据更加清晰的显示出来。 public class TreeNode : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; /// <summary> /// 监听属性改变事件 /// </summary> /// <param name="info"></param> private void NotifyProperChanged(string info) { ...
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代码: 1234567<TreeView Name="TreeView" ItemsSource="{Binding TreeNodes}" HorizontalAlignment="Left" Height="325" Margin="25,60,0,0" Vertica...
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...
Revit二次开发使用投影到面Project坐标提取错误
今天在写代码的时候使用face.Project这个节点取投影点,实现通过点的修改完成对斜面的附着功能。在之前使用这个节点的时候没有发现问题,今天测试时如果将目标便宜到很低的一个点,是同投影到面节点,最终会造成一个比较大的误差。(如果是自己的节点使用错误,希望能够留言提醒-。-!)。可以看到两个柱帽偏移的情形,在一个比较大的偏移量下,向上方投影会造成目标的偏移值出现较大的误差。通过几组简单的测试发现距离越大,最终的误差越多。之前调整柱帽是在一个楼板坡度较小而且距离较小的情况下进行测试,没有发现问题。通过人工测算,斜面情况下,目标据顶面在150mm以内数值调整时准确的。平面数值不影响。为了得到比较精确的调整,最后采用了射线相交法,通过 public ReferenceIntersector( ElementFilter filter, FindReferenceTarget targetType, View3D view3d ) 可以实现点的精确捕捉,因为我想调整到顶面,所以如果目标在下方想上方投影,需要将顶板厚度考虑进去,射线相交的第一个面为底面,如果不考虑厚度变量,最后会...
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...







